Concurrency issue between handle_msg and send_msg

During the processing of a received message an agent cannot send any message on the bus. The problem occurs when we receive a message that requires some time to be processed, although the lib is threaded it is not possible to send cyclic messages from the agent main loop. After a review of the code, in the file ivy.py different resources are protected by the same lock : self._subscriptions and self._clients. However the send_msg method accesses self._clients whereas the handle_msg method accesses self._subscriptions, hence two different locks could be used to void the deadlock. We are currently testing this solution and provide the code modification in attachment, hoping it proves to be good. ivy.py

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information