Repository navigation
HTCondor monitor: a failed schedd query is not an empty answer - #321
Conversation
When the schedd query raised, the HTCondor monitor went on with an empty result, so every worker of the batch read as missing; a failed condor_q or condor_history command was logged and treated the same way. Repeated unknown results then reached checkTimeout and the monitor killed the workers, though they were running. After a schedd outage on an OSG queue, live workers were cancelled this way and PanDA kept dispatching jobs to them. A failed query now returns a failure, and a failed command raises. The monitor keeps the status of the batch's workers, marks them unchecked and records WORKER_STATE_UNVERIFIED, instead of passing a status of None. A new HTCondorMonitor option, preserveUnknownWorkers (default false), keeps a worker whose scheduler state is unknown past checkTimeout instead of killing it; without it the timeout behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…afety change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
On schedd query failures, clearing workersToCheck skips messenger processing, delaying live-worker requests and updates and potentially leaving Event Service workers running without event ranges.
1 open issue
What changed in this PR
This PR distinguishes HTCondor query failures from empty scheduler results to prevent live workers from being cancelled during schedd outages.
Changes:
- Propagates query and command failures instead of treating them as missing workers.
- Preserves worker status and records unchecked-state diagnostics after batch failures.
- Adds
preserveUnknownWorkers, defaulting to false, to retain unknown workers beyondcheckTimeout.
| File | Description |
|---|---|
pandaharvester/harvestermonitor/htcondor_monitor.py |
Returns query failures and adds the preservation option. |
pandaharvester/harvestermisc/htcondor_utils.py |
Raises an exception when a Condor query command fails. |
pandaharvester/harvesterbody/monitor.py |
Handles failed batches and conditionally preserves unknown workers past timeout. |
Review effort: Balanced
| for unchecked in workersToCheck: | ||
| retMap[unchecked.workerID].update( | ||
| newStatus=unchecked.status, | ||
| monStatus=unchecked.status, | ||
| isChecked=False, | ||
| workAttributes=unchecked.workAttributes or {}, | ||
| diagMessage=f"WORKER_STATE_UNVERIFIED: monitor query failed: {tmpOut}", | ||
| ) | ||
| workersToCheck = [] | ||
| tmpOut = [] |
|
Is this PR finalized yet? I still see open suggested change from Copilot. |
With preserveUnknownWorkers, a worker whose scheduler state is unknown past checkTimeout was kept even when Harvester had already ordered its kill. A worker killed for queuing too long is removed from the schedd, and once its submission is older than useCondorHistoryMaxAge the history query skips it, so it stayed unknown and kept its status indefinitely, counting against the queue's worker limits while the sweeper repeated the kill every cycle. A worker of unknown state past checkTimeout whose kill is due is now ended as cancelled, keeping any pilot error already recorded. A worker without a kill order, or with a delayed kill not yet due, is kept as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; host-install.py --prefix edits.json for the osgsub01 monitor: a worker of unknown state past checkTimeout whose kill is due is ended as cancelled instead of kept (HSF/harvester#321). host-install.py takes --prefix so it installs under /opt/harvester as well as /opt/panda. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Yes, this is ready from our side. On the open Copilot suggestion: clearing |

When the schedd query raises,
HTCondorMonitor.check_workerscontinues with an empty result, so every worker of the batch reads as missing. A failedcondor_qorcondor_historycommand is logged and treated the same way. The repeated unknown results reachcheckTimeout, and the monitor kills the workers although they are running. After a schedd outage on an OSG queue at BNL, live workers were cancelled this way while PanDA kept giving them jobs.A failed query now returns a failure, and a failed command raises. The monitor keeps the status of the batch's workers, marks them unchecked and records
WORKER_STATE_UNVERIFIED. Before, it passed a status ofNone, which stopped the update of the whole chunk. A new HTCondorMonitor option,preserveUnknownWorkers(default false), keeps a worker whose scheduler state is unknown pastcheckTimeoutinstead of killing it; without it the timeout behaves as before.A worker Harvester has already ordered killed is not kept: when its kill is due and its scheduler state is unknown past
checkTimeout, it is ended as cancelled, keeping any pilot error already recorded. A worker killed for queuing longer thanworkerQueueTimeLimitleaves the schedd, and the history query skips it once its submission is older thanuseCondorHistoryMaxAge, so without this it kept its status indefinitely and counted against the queue's worker limits while the sweeper repeated the kill. On the BNL OSG queue 421 such workers held its waiting limit until they were ended by hand.Running on the ePIC OSG harvester at BNL since 2026-10-25, with the option's behaviour always on, and the ending of killed workers since 2026-11-04.
🤖 Generated with Claude Code