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 suspend in session master when fork_on_start #296

Merged
merged 1 commit into from
Apr 11, 2024

Commits on Apr 10, 2024

  1. [fg] track master proc for suspend via pids, not term fds, for fork_o…

    …n_start
    
    When ui.sessions.fork_on_start, we fork a process that has a different
    fdout than get_output_handle() (which has hardcoded fdout of 1), so it
    will never be considered term->master, yet this is the process we want
    to wake up in SIGTSTP handler.
    
    Since we cannot rely on term->master to determine if we are the master
    process, we instead move master_pid to be set explicitly at the places
    where we have information about whether our process is a master or a
    slave: first on start, then once the interlink determination has been
    made.
    
    master_pid has to be set in both parent and child, because both will get
    suspended and need to know which one needs to resume in background with
    SIGCONT (the master).  We can't inherit from the parent because it's
    unknown at the time of fork.
    
    Previously, master_pid worked correctly with fork_on_start=0,
    -no-connect or -dump, but not with fork_on_start=1.
    
    See rkd77#287 for background.
    smemsh committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    b2556aa View commit details
    Browse the repository at this point in the history