-
Notifications
You must be signed in to change notification settings - Fork 450
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
Switch all error
and exception
logger calls to warning
if they do not lead to a crash.
#7861
Comments
To me, a warning is something that can be ignored for a while, and we should not ignore serious Core errors (at least in development) even if those errors do not lead to an immediate Core crash. Also, parsing the last Core output to extract the reason for the last crash looks like a hack. Even if we change the level of all errors that do not lead to the Core crash to warnings, it still looks possible that a critical error causes a cascade of other critical errors, and the last error in the Core output will still not be the initial error that caused the crash. My concern is that by switching all non-crashing errors to warnings, we start ignoring them more in development. Instead, we can extend #7699 in the follow-up PR and provide a robust way to send Core errors to GUI not via the stderr output but via files. Then, in case of the Core crash, we can be sure that the actual error leading to the last Core crash is stored in the last error file, and there should no longer be ambiguity. Saying this, I'm not against changing some specific non-critical errors to warnings. |
In general, if there is an exception or an error, I tend to use the same log level. The reason being, at the point of logging, the error or exception may or may not be clear whether it crashes (or should crash) the application. The exception may be re-raised again after logging as well.
Instead of all error or exception logger calls, I would go for case-by-case basis wherever it makes sense.
I agree with @kozlovsky here. |
Here are my first three results from searching through the codebase: tribler/src/tribler/core/components/content_discovery/community/content_discovery_community.py Lines 360 to 372 in 1c6baad
tribler/src/tribler/core/components/tunnel/community/tunnel_community.py Lines 96 to 102 in 1c6baad
tribler/src/tribler/core/components/tunnel/community/tunnel_community.py Lines 301 to 306 in 1c6baad
Are these serious errors, or just warnings? |
I can't comment on the last one, but the first two look like errors. We should investigate these errors and fix the reason or improve the error handling by making it less broad and generic. |
@kozlovsky @xoriole, thank you for sharing your opinions. Since it is now clear that there is no support for the suggested improvement, I am closing the issue. |
Currently, we use
error
,exception
, andwarning
logger calls in Tribler without any established system.I propose the following approach:
The lack of a systematic approach to using these log levels complicates the investigation of bugs and leads to false error detection for
CoreCrashedError
. When Sentry parses the core output, it identifies the closest logged ERROR, assuming it's the root cause of theCoreCrashedError
(see example #7855). However,CoreCrashedError
itself often doesn't provide much insight into the cause.If we agree on this approach, I can perform the switch (estimated time: 2 hours).
The text was updated successfully, but these errors were encountered: