Skip to content

Guard every batch wait and catch SIGTERM so a killed run still reports - #52

Merged
zaihuaji merged 1 commit into
mainfrom
hua-work-dsquasar
Oct 2, 2026
Merged

zaihuaji merged 1 commit into
mainfrom
hua-work-dsquasar

Conversation

@zaihuaji

@zaihuaji zaihuaji commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • check_child(..., -1) blocks for as long as all child slots stay busy, with the walltime deadline check stranded outside that loop, so an -A 3 run whose children each tar ~100GB walked past the cutoff and was killed by PBS without parking a report. New wait_child_slot() polls and checks the deadline between polls, mirroring the existing wait_all_children(); both remaining blocking waits now use them.
  • Four more silent-kill paths closed: report_dscheck_email() marked the report delivered before trying to park it (a failed cache parked nothing and disabled every later attempt); the quit path waited for children unguarded; the deadline guard excluded -A 16/32/64/128, which are submitted with the same 24h walltime; ACTMSG has no wording for the hidden actions, so building the report raised KeyError.
  • PBS sends SIGTERM before SIGKILL and nothing trapped it. A batch run now catches it and parks a report in the seconds it has left, as a backstop for what the walltime cutoff cannot cover.

Test plan

  • python3 -m py_compile src/rda_python_dsquasar/dsquasar.py
  • restore-default-and-reraise signal pattern verified standalone (handler runs, process still exits 143)
  • watch the next production dsquasar -a -A 3 -e -b -d PBS run for a report when it hits the walltime

…s; bump version to 3.0.20

A PBS run could pass its walltime and be killed without ever reporting. The
slot-acquire wait check_child(..., -1) blocks for as long as all child slots
stay busy, with the deadline check stranded outside that loop, so a run whose
children each tar ~100GB walked past the cutoff while waiting. New
wait_child_slot() polls instead and checks the deadline between polls, the same
way wait_all_children() already guards the terminal wait; both of the remaining
blocking waits now use them.

Four more ways a run could die unheard:
- report_dscheck_email() marked the report delivered before trying to park it,
  so a failed cache both parked nothing and disabled every later attempt
- the quit path waited for children unguarded and was killed before its email
- the deadline guard excluded -A 16/32/64/128, which are submitted with the
  same 24 hour walltime
- ACTMSG has no wording for the hidden actions, so building the report raised
  KeyError instead

PBS sends SIGTERM before the SIGKILL and nothing trapped it. A batch run now
catches it and parks a report in the seconds it has left, as a backstop for the
cases the walltime cutoff cannot cover.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zaihuaji
zaihuaji merged commit e28fedf into main Oct 2, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant