Skip to content

less verbose handled synapse exceptions#1928

Merged
thewhaleking merged 3 commits intoopentensor:stagingfrom
backend-developers-ltd:less_verbose_synapse_exc
May 29, 2024
Merged

less verbose handled synapse exceptions#1928
thewhaleking merged 3 commits intoopentensor:stagingfrom
backend-developers-ltd:less_verbose_synapse_exc

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
@thealligatorking thealligatorking 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.

2 participants