Fix TorControlSocket shutdown hang by adding timeout#256
Open
MHT417 wants to merge 2 commits intoRetroShare:masterfrom
Open
Fix TorControlSocket shutdown hang by adding timeout#256MHT417 wants to merge 2 commits intoRetroShare:masterfrom
MHT417 wants to merge 2 commits intoRetroShare:masterfrom
Conversation
csoler
reviewed
Feb 1, 2026
|
|
||
| if(line.empty()) // This happens when the incoming buffer isn't empty yet doesn't have a full line already. | ||
| { | ||
| if (++empty_line_cnt > MAX_EMPTY_RETRIES || shouldStop()) { |
Contributor
There was a problem hiding this comment.
What happens here is the network is somehow stuck (due to some lag)? The TorControlSocket process will stop. I'm not sure you want that, unless there is a built-in mechanism to get it to restart when needed.
Author
There was a problem hiding this comment.
It gets stuck when quitting a tor node, or occasionally even without quitting. the thread will just wait forever unless a timeout exists. it was tested again on a tor node after applying a timeout and the issue never occurred, RS will run without getting stuck
Contributor
There was a problem hiding this comment.
Sorry I mispelled. I wanted to say "what happens IF the network is somehow stuck".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TorControlSocket::process() has an infinite loop that doesn't check the
thread stop flag, this causes the thread to loop forever
Added timeout check to allow clean thread termination.