jason810496 opened a new pull request, #70573:
URL: https://github.com/apache/airflow/pull/70573

   `SSHRemoteJobOperator` launches the remote job detached under `setsid` so it 
survives the SSH connection dropping. The wrapper redirected the job's 
stdout/stderr to `/dev/null` but left its **stdin** on the launching terminal. 
A fresh `setsid` session leader that still holds a terminal on any fd re-adopts 
it as its controlling terminal, so when an SSH session that allocated a PTY 
(`get_pty=True`) hangs up, the detached job receives `SIGHUP` and dies — 
orphaning the work the operator exists to keep alive.
   
   Redirecting stdin from `/dev/null` as well (standard daemonization) leaves 
the job in a session with no controlling terminal, immune to the hangup.
   
   This is also the root cause of the flaky 
`test_kill_terminates_whole_job_tree_under_job_control`: its PTY harness hangs 
up the terminal and then asserts the job is still running. The job was being 
killed by that hangup, which the `@pytest.mark.flaky(reruns=5)` marker only 
masked. With the wrapper fixed the test is deterministic, so the marker and its 
stale "process-group race" comment are removed.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to