diff --git a/src/plumpy/processes.py b/src/plumpy/processes.py index ecffb1f4..6a3d0fb8 100644 --- a/src/plumpy/processes.py +++ b/src/plumpy/processes.py @@ -34,7 +34,7 @@ except ModuleNotFoundError: from contextvars import ContextVar -from aio_pika.exceptions import ConnectionClosed +from aio_pika.exceptions import ChannelInvalidStateError, ConnectionClosed import kiwipy import yaml @@ -718,7 +718,7 @@ def on_entered(self, from_state: Optional[process_states.State]) -> None: self.logger.info('Process<%s>: Broadcasting state change: %s', self.pid, subject) try: self._communicator.broadcast_send(body=None, sender=self.pid, subject=subject) - except ConnectionClosed: + except (ConnectionClosed, ChannelInvalidStateError): message = 'Process<%s>: no connection available to broadcast state change from %s to %s' self.logger.warning(message, self.pid, from_label, self.state.value) except kiwipy.TimeoutError: