Repository navigation
Conversation
Unexpected connect/read errors logged a full backtrace on every reconnect attempt. Ruby and Python now log it only the first time each distinct message is seen. Python also stops logging backtraces for expected network errors: the `is Exception` check was always false and lost connections had no filter at all. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3999 +/- ##
==========================================
+ Coverage 80.06% 80.15% +0.09%
==========================================
Files 901 901
Lines 68370 68455 +85
Branches 2699 2661 -38
==========================================
+ Hits 54738 54869 +131
+ Misses 12976 12918 -58
- Partials 656 668 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| pass # Do not write an exception file for these extremely common cases | ||
| # Only log the backtrace the first time we see each distinct error | ||
| elif str(error) not in self.connection_lost_messages: | ||
| self.logger.error(f"{self.interface.name}: {''.join(traceback.format_exception(error))}") |
Member
Author
There was a problem hiding this comment.
All ty errors in interface_microservice.py handled in another PR.
The connection failed/lost message lists were never cleared, so a backtrace was logged only once for the life of the microservice. They are now cleared on a successful connect and when the user requests a connect. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
connectorreadlogged a full backtrace on every reconnect attempt, so a persistent fault flooded the log. Theconnection_failed_messages/connection_lost_messageslists only de-duplicated themselves. The backtrace is now logged only the first time each distinct message is seen; repeats still log the one-line "Connection ... failed due to" / "Connection Lost:" message.attempting, including connect after a disconnect), so the next failure logs its backtrace again. Automatic reconnect attempts do not clear them.handle_connection_failed: the expected-error check usedconnect_error is Exception, which is always false, so every failure (including connection refused) logged a traceback. It now usesisinstance.handle_connection_lost: had no expected-error filter. It now has one.IOErroris an alias forOSError, so Ruby's lists are mapped asConnectionError(refused/reset/aborted),TimeoutError, andOSErrorwith the same errnos Ruby lists (ENOTSOCK/EHOSTUNREACHfor failed,EBADF/ENOTSOCKfor lost). A plainOSErrorsuch asPermissionErrorstill logs a backtrace.Fixes the IF-CON-006 deviations in
architecture/specs/interface-microservice.yaml.Test plan
bundle exec rspec spec/microservices/interface_microservice_spec.rb(29 examples, 0 failures). 3 of the 5 new examples fail on the old code.uv run pytest test/microservices/test_interface_microservice.py(30 passed). All 5 new tests fail on the old code.ruff check/ruff format --checkon the changed source🤖 Generated with Claude Code