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

fix: start process subreaper at top level to avoid shutdown hangs #380

Merged
merged 2 commits into from
Mar 12, 2024

Commits on Mar 11, 2024

  1. fix: start process subreaper at top level to avoid shutdown hangs

    For example, if an exec command is running when you Ctrl-C the Pebble
    daemon, it hangs.
    
    It's hanging because the ServiceManager is stopping the reaper early in
    the process, before TaskRunner has had a chance to abort the exec tasks
    (aborting an exec task sends SIGKILL to its pid via the tomb and
    command context).
    
    Then when TaskRunner.Stop is called, it calls tomb.Kill and then
    tomb.Wait on each task (exec) tomb, and because the reaper's not
    running, the tomb.Wait hangs.
    
    So the fix is to move the reaper.Start and reaper.Stop to the top
    level (inside the "run" command, which is also used for "enter"),
    instead of putting them in servstate.NewManager and
    ServiceManager.Stop.
    
    After doing this, some of the tests also had to be modified to start
    and stop the reaper.
    
    Fixes canonical#163
    benhoyt committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    3314276 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Configuration menu
    Copy the full SHA
    302500a View commit details
    Browse the repository at this point in the history