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

Tribler Core process continues to work after the GUI process crash #6994

Closed
kozlovsky opened this issue Aug 12, 2022 · 0 comments · Fixed by #6995
Closed

Tribler Core process continues to work after the GUI process crash #6994

kozlovsky opened this issue Aug 12, 2022 · 0 comments · Fixed by #6995
Assignees
Milestone

Comments

@kozlovsky
Copy link
Contributor

Tribler's GUI process starts the Core process using QProcess. It may be expected that the Core process is a child process and should terminate after the crash of the parent process. But it is not the case. As it turns out, Qt terminates child processes only when the parent process terminates correctly. If the parent process crashes, child processes started with QProcess continue to work.

To reproduce the error you can start Tribler and kill Tribler GUI process (for example, with ProcessExplorer on Windows). You can see that the second tribler.exe process continues to work and tribler-core-info.log/tribler-core-error.log files are used by this process.

In this situation, if Tribler is restarted, Core should stop immediately with the following error:

CoreCrashedError
The Tribler core has unexpectedly finished with exit code 1 and status: 0!
Last core output: 
 [PID:22891] 2022-08-11 22:50:32,198 - INFO - tribler.core.logger.logger(64) - Config loaded for app_mode=tribler-core
[PID:22891] 2022-08-11 22:50:32,198 - INFO - tribler.core.start_core(174) - Core is already running, exiting

The recommended approach for dealing with this QProcess problem is implementing a heart-beat check in the Core process that checks that the GUI is still alive and terminates Core otherwise. For this, we can have a separate component that monitors the GUI process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant