[Code scan] Handle header-only LSF and JH status output
bug
Found by a Codex global repository scan of deepmodeling/dpdispatcher at commit 98a9e08.
Problem
LSF and JH_UniScheduler status parsing assumes a second output line always contains job data. Header-only output with a trailing newline produces an empty second line, then `split()[2]` raises `IndexError`.
Relevant code
https://github.com/deepmodeling/dpdispatcher/blob/98a9e081ea583a5811490e53ba2c4151d1d8b01d/dpdispatcher/machines/lsf.py#L131-L136
https://github.com/deepmodeling/dpdispatcher/blob/98a9e081ea583a5811490e53ba2c4151d1d8b01d/dpdispatcher/machines/JH_UniScheduler.py#L107-L112
Impact
Polling can crash when a scheduler returns only headers for a completed, expired, or missing job instead of falling back to finish-tag logic.
Suggested fix
Strip empty lines, require a data row before indexing, and if no data row exists check the finish tag and otherwise return a terminal/unknown state intentionally.
0 条评论