diff --git a/comm/base_comm.py b/comm/base_comm.py index 058e557..623fcd0 100644 --- a/comm/base_comm.py +++ b/comm/base_comm.py @@ -284,6 +284,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: