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

Skip shutdown request clearing on Tribler shutdown #7202

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

xoriole
Copy link
Contributor

@xoriole xoriole commented Nov 23, 2022

Tribler can get stuck on shutdown if the request to shutdown is canceled already at the GUI level. Issue and logs are present in #7177

This PR excludes the shutdown request from being cleared while shutting down making sure that the shutdown request is sent to the Core.

Fixes #7177

@xoriole xoriole marked this pull request as ready for review November 23, 2022 15:41
@xoriole xoriole requested a review from a team as a code owner November 23, 2022 15:41
@xoriole xoriole requested review from drew2a and removed request for a team November 23, 2022 15:41
@drew2a drew2a requested review from kozlovsky and removed request for drew2a November 23, 2022 15:43
@xoriole xoriole requested a review from drew2a November 24, 2022 09:01
@xoriole xoriole force-pushed the fix/shutdown-issue branch 2 times, most recently from 45c5f6a to 361411c Compare November 24, 2022 11:06
@xoriole xoriole requested a review from drew2a November 24, 2022 11:16
Copy link
Collaborator

@kozlovsky kozlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, I like the changes in this PR. Instead of re-sending a canceled shutdown request, now the code does not cancel the request, and it looks much more logical than before.

With this, I do not fully understand the origin of the problem in issue #7177. The log that I see looks ok to me, and the code behaves as expected:

[PID:605050] 2022-11-16 14:34:37,316 - INFO - CoreManager(187) - Stopping Core manager
[PID:605050] 2022-11-16 14:34:37,317 - INFO - CoreManager(203) - Sending shutdown request to Tribler Core
[PID:605050] 2022-11-16 14:34:37,320 - WARNING - root(252) - Request from GUI to Core was canceled: http://localhost:52195/shutdown
[PID:605050] 2022-11-16 14:34:37,321 - WARNING - CoreManager(205) - Re-sending shutdown request to Tribler Core

The shutdown request was canceled, and then it was re-sent again. It looks contrived but should work, so the log lines look as expected.

But are these the last lines of the log file? Then it is strange. If the shutdown request was not re-sent properly, I expect additional lines in the log, at least from the working Core.

And, if Core ignored the re-sent shutdown request, then the problem may be on the Core side.

So, if we have a problem with the shutdown, I'm not sure these changes should fix it, but the code definitely looks better than before.

@xoriole
Copy link
Contributor Author

xoriole commented Dec 7, 2022

As discussed offline, this PR might not fix the issue but still improves the code so I'll merge it.

@xoriole xoriole merged commit bd973de into Tribler:main Dec 7, 2022
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.

Tribler does not close if left idle for a few hours
3 participants