Computing "elapsed" breaks when start or end is none
jcklie opened this issue · comments
Jan-Christoph Klie commented
Versions
OS version: Centos 7
Slurm version: 22.05
Slurm Mail version: 4.1 Snapshot
Describe the bug
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'. I think this is related to #58 .
Logs
2022/11/02 12:42:03:ERROR: unsupported operand type(s) for -: 'int' and 'NoneType'
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/slurmmail/cli.py", line 587, in send_mail_main
__process_spool_file(f, smtp_conn, options)
File "/usr/lib/python3.6/site-packages/slurmmail/cli.py", line 275, in __process_spool_file
job.save()
File "/usr/lib/python3.6/site-packages/slurmmail/slurm.py", line 203, in save
self.elapsed = (self.__end_ts - self.__start_ts)
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Neil Munday commented
Resolved by this commit
I think we need to find out why job start times are not being returned by Slurm for jobs that started also.