fix(worker): keep a signal that arrives before the job has started (bug-1908)

The controller forwards a kill as soon as it has dispatched a job, but
the worker queues the start and only registers the job (and, for the
real worker, connects its IPC client) once it starts -- seconds later
for the first jobs after a worker starts. A signal arriving in between
was dropped ("Failed to find worker"), although the API reported it
accepted, and the job ran to completion.

New pending_signal table: the start handler records the job, a signal
for a queued or still-starting job is kept there, and it is delivered
when the job reaches RUNNING (virtual: killed_signal; real: IPC). A
failed start or a job that ends drops the entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-02 02:50:32 +00:00
parent 7d6a6e6043
commit 8b7173bb09
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
10 changed files with 370 additions and 5 deletions

View file

@ -7,6 +7,7 @@ xcecd_worker_srcs = [
'src/static_array.c',
'src/xcecd_cgroups.c',
'src/xcecd_worker_utils.c',
'src/pending_signal.c',
'src/xcecd_resync.c',
'src/controller_connector.c',
'src/xcecd_dbus_manager.c',
@ -88,7 +89,8 @@ xcecd_srcs = [
'src/xcecd_resync.c',
'src/hardware_monitor.c',
'src/node_information.c',
'src/job_information.c'
'src/job_information.c',
'src/pending_signal.c'
]
xcecd_deps = [xcecd_worker_deps]