Repository navigation
Conversation
…f swallowing them Failures from tentacles requirement lookup were silently dropped in OctoBotBacktesting._create_services. Log them with the evaluator name and keep the non-fatal behaviour. Co-authored-by: herklos.dev <herklos.dev@protonmail.com>
Comment on lines
+386
to
+391
| self.logger.exception( | ||
| e, | ||
| False, | ||
| f"Failed to resolve service requirements of {evaluator.__class__.__name__} for backtesting, " | ||
| f"its required services might not be started" | ||
| ) |
There was a problem hiding this comment.
BotLogger.exception only writes error_message via self.error when the second argument is true. With False, the logging call receives the exception object as the message, and the file format is %(message)s, so the log line is the exception text plus the traceback. The evaluator name stays on extra["exception_desc"] and does not appear.
The other logger.exception calls in this file pass True. The init failure just below uses logger.error, which does put its sentence in the log and counts it as a backtesting error.
Pass True here, or log the same sentence with logger.error, so the evaluator name is in the log.
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
Stop silently dropping errors raised while resolving the service classes required by backtesting evaluators.
Changelog
OctoBotBacktesting._create_serviceslogs requirement lookup failures with the evaluator name instead ofexcept Exception: passWhat's new?
_create_serviceswalks the evaluators and askstentacles_manager_api.get_tentacle_classes_requirementswhich services each one needs. Any failure in that loop was swallowed, so a backtesting run could start without a service it needs and nothing was logged.The handler now calls
logger.exceptionwith the evaluator name and keepspublish_error_if_necessaryoff, matching the existing service-initialization error log right below it. The exception type is not narrowed yet, since the set of expected failures is not known; that can follow once they are catalogued.Testing
pytest tests/unit_tests/backtesting: the new "logs exception" test fails before the fix and passes afterpytest packages/backtesting/tests -n auto --dist loadfile: 78 passedpytest tests/unit_tests -n auto --dist loadfile: 502 passedpython -m tools.extended_linter --base origin/dev: 0 violations