-
Notifications
You must be signed in to change notification settings - Fork 451
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
Fix components startup #6507
Fix components startup #6507
Conversation
5d54456
to
a574f53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
I wrote some comments about the PR and Pylint and Flake8 should be satisfied before PR can be merged.
b3823be
to
d622a2c
Compare
I changed the logic for the component to have |
…aceback spam in log when a dependency for multiple components is missing
…eption from `component.start()` in a separate task to prevent Tribler from crashing on start
8a321bb
to
2f58d59
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR fixes the following problem: it becomes impossible to close Tribler when a component's
run
method raises an error.The reason for this behavior is the following:
Session
was started with the defaultfailfast=True
option;start
method propagates the first exception from a failedcomponent.run
method;The desired behavior is the following:
This PR does the following to fix the problem:
failfast=False
option.run
method, it is raised again in a separate branch to be processed by Sentry (raising it in the original branch will stop the event loop).should_stop
field was added to the exception's notification from Core to GUI to prevent automatic stopping of Tribler after the error was reported to Sentry.As an example of error, the case of TagsDatabase failure was considered caused by the incorrect structure of tables. I added defensive checks to other parts of the code in a separate commit so Tribler could successfully start even if TagsComponent could not run.
As a separate commit, I added a possibility to have errors reported from Core to GUI, which are not critical enough to cause Tribler shutdown, so they are passed with the
should_stop=False
flag. In case of repeating errors, new occurrences will be suppressed silently not to disturb the user interface.Also, I noticed that errors in REST API are not reported to Sentry and displayed to the user in a separate dialog window. It is too big a task to be included in this PR, so I added a TODO option and will open a related issue.
Related to #6263