Skip to content

Recover SKIPPED state when supervisor IPC fails on terminal-state send#67266

Open
haseebmalik18 wants to merge 1 commit into
apache:mainfrom
haseebmalik18:task-sdk-preserve-skipped-intent-on-ipc-fail
Open

Recover SKIPPED state when supervisor IPC fails on terminal-state send#67266
haseebmalik18 wants to merge 1 commit into
apache:mainfrom
haseebmalik18:task-sdk-preserve-skipped-intent-on-ipc-fail

Conversation

@haseebmalik18
Copy link
Copy Markdown
Contributor

@haseebmalik18 haseebmalik18 commented May 21, 2026

If a task is going to be SKIPPED and the IPC send of TaskState(SKIPPED) to the supervisor raises, the failure gets logged and swallowed. The subprocess exits 0, the supervisor sees no terminal state, and final_state defaults to SUCCESS. SUCCESS is in STATES_SENT_DIRECTLY so no finish() call is made either, and the TI sits at RUNNING on the server until something else cleans it up.

Fix is a small pre-announcement: before sending the real TaskState(SKIPPED), the subprocess sends
SetIntendedTerminalState(SKIPPED). Supervisor stores it on _last_intended_state, and final_state uses it as a fallback when the bigger message never lands. Same shape as the SERVER_TERMINATED override that already
exists alongside it.

Nothing changes on the worker side. No sys.exit(1), finalize() still runs, on_skipped_callback and the skipped listener hook fire as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant