Skip to content

Commit c81298d

Browse files
committed
batchspawner/batchspawner: .clear_state() if spawning fails
- The query_job_state change meant we don't call .poll() within the .start() method anymore. .poll() would .clear_state() if the job was not found. - So old state was: .clear_state() was called if the spawn failed. - Add in .clear_state() explicitely when spawning fails. - I think that if there are exceptions in unexpected places, then state will still not be cleared. It's no worse than before, so we can leave it is-is for now.
1 parent 7dda947 commit c81298d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

batchspawner/batchspawner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ async def start(self):
390390
else:
391391
self.log.warning('Job ' + self.job_id + ' neither pending nor running.\n' +
392392
self.job_status)
393+
self.clear_state()
393394
raise RuntimeError('The Jupyter batch job has disappeared'
394395
' while pending in the queue or died immediately'
395396
' after starting.')

0 commit comments

Comments
 (0)