diff --git a/comm/base_comm.py b/comm/base_comm.py index 6bf4c48..dc0abb1 100644 --- a/comm/base_comm.py +++ b/comm/base_comm.py @@ -290,6 +290,21 @@ def comm_msg(self, stream: ZMQStream, ident: str, msg: MessageType) -> None: # comm_id = content["comm_id"] comm = self.get_comm(comm_id) if comm is None: + try: + from comm import create_comm + + closed_comm = create_comm( + comm_id=comm_id, + primary=False, + target_name=None, + ) + closed_comm.close() + except Exception: + logger.error( + """Could not send comm_close for a closed comm to reply + for incoming communication""", + exc_info=True, + ) return try: