Skip to content

Commit

Permalink
Engine: Fix paused work chains not showing it in process status (#6206)
Browse files Browse the repository at this point in the history
When child processes of a `WorkChain` are completed, the process status
of the work chain is updated. However, the `_update_process_status` was
not taking into account whether the work chain was paused and would
simply override the paused message. This would result in the process
status being shown as `Waiting`, but actually the process is paused and
so it would look stuck.

Instead, the method now simply updates the `_pre_paused_status` with the
new status in case the work chain is paused. This way, it will continue
to be shown as paused, but as soon as it is resumed, the new status will
be correctly set.
  • Loading branch information
superstar54 authored Mar 12, 2024
1 parent 6d09841 commit 40b22d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/aiida/engine/processes/workchains/workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,14 @@ def _update_process_status(self) -> None:
"""Set the process status with a message accounting the current sub processes that we are waiting for."""
if self._awaitables:
status = f"Waiting for child processes: {', '.join([str(_.pk) for _ in self._awaitables])}"
self.node.set_process_status(status)
else:
self.node.set_process_status(None)
status = None
if self.paused:
# Update the pre-paused status so that when the process is played
# it will be set to the new status
self._pre_paused_status = status
else:
self.set_status(status)

@override
@Protect.final
Expand Down

0 comments on commit 40b22d5

Please sign in to comment.