Skip to content

Commit

Permalink
apply consistency fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Feb 8, 2021
1 parent 6270c5e commit 03d5b5e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions aiida/engine/processes/calcjobs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def do_upload():
except PreSubmitException:
raise
except (plumpy.futures.CancelledError, plumpy.process_states.Interruption):
pass
raise
except Exception:
logger.warning(f'uploading CalcJob<{node.pk}> failed')
raise TransportTaskException(f'upload_calculation failed {max_attempts} times consecutively')
Expand Down Expand Up @@ -139,15 +139,16 @@ async def do_submit():

try:
logger.info(f'scheduled request to submit CalcJob<{node.pk}>')
ignore_exceptions = (plumpy.futures.CancelledError, PreSubmitException, plumpy.process_states.Interruption)
result = await exponential_backoff_retry(
do_submit,
initial_interval,
max_attempts,
logger=node.logger,
ignore_exceptions=plumpy.process_states.Interruption
ignore_exceptions=ignore_exceptions
)
except plumpy.process_states.Interruption:
pass
except (plumpy.futures.CancelledError, plumpy.process_states.Interruption):
raise
except Exception:
logger.warning(f'submitting CalcJob<{node.pk}> failed')
raise TransportTaskException(f'submit_calculation failed {max_attempts} times consecutively')
Expand Down Expand Up @@ -201,14 +202,15 @@ async def do_update():

try:
logger.info(f'scheduled request to update CalcJob<{node.pk}>')
ignore_exceptions = (plumpy.futures.CancelledError, PreSubmitException, plumpy.process_states.Interruption)
job_done = await exponential_backoff_retry(
do_update,
initial_interval,
max_attempts,
logger=node.logger,
ignore_exceptions=plumpy.process_states.Interruption
ignore_exceptions=ignore_exceptions
)
except plumpy.process_states.Interruption:
except (plumpy.futures.CancelledError, PreSubmitException, plumpy.process_states.Interruption):
raise
except Exception:
logger.warning(f'updating CalcJob<{node.pk}> failed')
Expand Down Expand Up @@ -270,14 +272,15 @@ async def do_retrieve():

try:
logger.info(f'scheduled request to retrieve CalcJob<{node.pk}>')
ignore_exceptions = (plumpy.futures.CancelledError, plumpy.process_states.Interruption)
result = await exponential_backoff_retry(
do_retrieve,
initial_interval,
max_attempts,
logger=node.logger,
ignore_exceptions=plumpy.process_states.Interruption
ignore_exceptions=ignore_exceptions
)
except plumpy.process_states.Interruption:
except (plumpy.futures.CancelledError, plumpy.process_states.Interruption):
raise
except Exception:
logger.warning(f'retrieving CalcJob<{node.pk}> failed')
Expand Down

0 comments on commit 03d5b5e

Please sign in to comment.