Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

less verbose handled synapse exceptions #1928

Conversation

mjurbanski-reef
Copy link
Contributor

@mjurbanski-reef mjurbanski-reef commented May 23, 2024

The traceback being printed for expected exceptions is making logs less readable, and perhaps more importantly, possibly affective production service performance.

bittensor performs eager formatting of each of the logging message, and in this case, even traceback.format_exc() is used, which also has too lookup frames in stack, and open python code files etc to find the lines to print. This happens even if trace log level is disabled.

This patch prevents that from happening from explicitly thrown SynapseException subclasses, that is, e.g. BlacklistedException preventing additional load and log noise.
The unknown exceptions still have full stacktrace printed as before, as they are quite useful for debugging, but the exceptions thrown on purpose (SynapseException subclasses) don't need it.

This change is inspire by case presented by @cxmplex in opentensor/bittensor-subnet-template#88

@thewhaleking thewhaleking merged commit 59aaac0 into opentensor:staging May 29, 2024
11 checks passed
@gus-opentensor gus-opentensor mentioned this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants