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

client: don't hang if detection processes hang #5190

Merged
merged 24 commits into from
Apr 12, 2023
Merged

Commits on Apr 9, 2023

  1. Code cleanup in preparation for fixing GPU detect issue

    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
    davidpanderson committed Apr 9, 2023
    Configuration menu
    Copy the full SHA
    ce28e67 View commit details
    Browse the repository at this point in the history
  2. Win build fixes

    davidpanderson committed Apr 9, 2023
    Configuration menu
    Copy the full SHA
    615c642 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    391f593 View commit details
    Browse the repository at this point in the history
  4. client: don't hang if detection processes hang

    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"
    davidpanderson committed Apr 9, 2023
    Configuration menu
    Copy the full SHA
    8444da6 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2023

  1. Win build fixes

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    c4912d6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a8b819 View commit details
    Browse the repository at this point in the history
  3. build fix in vboxwrapper

    get_exit_status(): dt<= means wait indefinitely; dt=0 means non-blocking
    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    450914e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cd1ca87 View commit details
    Browse the repository at this point in the history
  5. fix unit test build

    Note: the unit tests don't really test anything
    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    719e7ed View commit details
    Browse the repository at this point in the history
  6. Change some things back to the way they were;

    this PR is getting to big.
    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    df26141 View commit details
    Browse the repository at this point in the history
  7. Win build fixes

    Getting boinccas to build required some stuff I don't understand
    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    6d0e907 View commit details
    Browse the repository at this point in the history
  8. comment tweak

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    b70a88b View commit details
    Browse the repository at this point in the history
  9. linux build fix

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    9297527 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c3481b2 View commit details
    Browse the repository at this point in the history
  11. compile fix

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    75e2fd6 View commit details
    Browse the repository at this point in the history
  12. build fix

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    89af446 View commit details
    Browse the repository at this point in the history
  13. apple build fix

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    22006b5 View commit details
    Browse the repository at this point in the history
  14. apple compile fix

    davidpanderson committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    9ed61fc View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2023

  1. mac build fix

    davidpanderson committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    1f19ff3 View commit details
    Browse the repository at this point in the history
  2. mac build fix

    davidpanderson committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    5326bf5 View commit details
    Browse the repository at this point in the history
  3. Mac build fixes

    davidpanderson committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    7f86425 View commit details
    Browse the repository at this point in the history
  4. Move run_program() etc. from proc_control.cpp back to util.cpp.

    This required changing a bunch of project files,
    and was turning into a rabbit hole.
    davidpanderson committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    e08b75d View commit details
    Browse the repository at this point in the history
  5. Win: comment out (currently) unneeded fix

    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.
    davidpanderson committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    b808e06 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7af6498 View commit details
    Browse the repository at this point in the history