-
Notifications
You must be signed in to change notification settings - Fork 446
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
client: don't hang if detection processes hang #5190
Merged
Merged
Conversation
This file contains 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
lib/util.cpp had become a landfill of unrelated stuff - move the process-related code to lib/proc_control.cpp - move file-related code to lib/filesys.cpp - move client mutex code to client/main.cpp The client has 2 unrelated types of mutual exclusion: thread level (between the main and throttle threads) and process level (prevent 2 clients from running on a host). - Rename "client_mutex" to "client_thread_mutex". - parse.h: don't declare boinc_is_finite(); include the .h file
The client runs two "detection processes": - GPU detection - (Mac) check if in CPU emulation mode The client was waiting indefinitely for these to exit. If for some reason they don't exit, the client hangs. Fix: wait no more than 10 sec for them to exit. If still running, kill them and move on. I took the opportunity to clean up the process-related code: - add a time arg to get_exit_status(). If zero, wait indefinitely for the child to exit. Else wait no more than that amount. - get_exit_status() return an error code; the exit status is returned via a parameter. - run_program() no longer takes a time argument. If you want to check for early exit, use get_exit_status() - define PROCESS_ID as HANDLE (Win) or int (other) so we can unify the process interface - remove process_exists(). It wasn't used anywhere, and get_exit_status(... 0) does the same thing. - rename kill_program() to kill_process() - don't use "prog" when you mean "pid"
get_exit_status(): dt<= means wait indefinitely; dt=0 means non-blocking
Note: the unit tests don't really test anything
this PR is getting to big.
BrianNixon
reviewed
Apr 10, 2023
BrianNixon
reviewed
Apr 10, 2023
Getting boinccas to build required some stuff I don't understand
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5190 +/- ##
=========================================
Coverage 10.86% 10.86%
Complexity 1064 1064
=========================================
Files 279 279
Lines 35993 35980 -13
Branches 8258 8257 -1
=========================================
Hits 3911 3911
+ Misses 31690 31677 -13
Partials 392 392
|
This required changing a bunch of project files, and was turning into a rabbit hole.
AenBleidd
requested changes
Apr 11, 2023
The VS header files have a conflict: various structures (such as STRING) are defined differently in ntsecapi.h than in winternl.h This error appears off and on, for reasons I don't understand. Changes in lib/str_util.h seem to trigger it. Earlier in this PR is was happening. I found a workaround on stackoverflow.com and added it. But now the error is not happening, even without the workaround. So, for now, I'm commenting out the workaround. It's there if we need it in the future.
AenBleidd
approved these changes
Apr 12, 2023
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.
The client runs two "detection processes":
- GPU detection
- (Mac) check if in CPU emulation mode
The client was waiting indefinitely for these to exit.
If for some reason they don't exit, the client hangs.
Fix: wait no more than 10 sec for them to exit.
If still running, kill them and move on.