reorganize main classes inheritance: the publisher, async publisher , subscriber, async subscriber , client, async client classes are now derived from a same class which simplifies maintenance
fix typo on receive, forward_request, response_required
create a generic function to handle zmq errors and exceptions, which now can try and reset the socket on certain critical errors and raise back the exceptions
added tests of those ZMQ classes using a simple server and multiple types of clients sending requests synchronously, asynchronously, with lock, without lock, with response required or not, etc ...
Bugfix:
on some scenarios, the ZMQ clients could enter a deadloop when send() requests were made on an unhealthy socket, this could occur mainly when displaying logs on the IDE, they would never appear and the backend container would use a full CPU
non instrumented code looped on : [ERROR][2024-05-24 11:59:40][zmq_client][send][116]: AsyncZMQClient failed to send message, got exception of type Socket operation on non-socket
instrumented code looped on : [WARNING][2024-05-24 12:32:49][zmq_client][handle_socket_errors][88]: ZMQ socket error: tcp://message-server:9000 got exception: Socket operation on non-socket.
now, the ZMQ clients handle this exception and others and try and reset this socket which forces a clean re-connection. On IDE logs page, the impact of such a reset is then transparent and backend container continues healthy
/apps/mov-fe-app-ide/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
[WARNING][2024-05-24 12:32:49][zmq_client][handle_socket_errors][88]: ZMQ socket error: tcp://message-server:9000 got exception: Socket operation on non-socket.
[WARNING][2024-05-24 12:32:49][zmq_client][handle_socket_errors][90]: Resetting ZMQ {self._addr} with potential data loss.
[INFO][2024-05-24 12:32:49][zmq_client][_reset][61]: ZMQ connecting DEALER to: tcp://message-server:9000
TODO:
find a better pattern to fix the way some class member functions are defined with either sync or async prototype leads to an error of type [Method 'forward_request' was expected to be 'non-async', found it instead as 'async' (invalid-overridden-method)](https://sonarcloud.io/project/issues?pullRequest=156&open=AY-nrWP_VkCPe5gxPlk6&id=MOV-AI_movai-core-shared)
extend tests to compare performance of UDP, TCP vs UNIX sockets
[x] Make sure you are opening from a topic/feature/bugfix branch
[x] Ensure that the PR title represents the desired changes
[x] Ensure that the PR description detail the desired changes
[x] Link to relevant issues in GitHub or Jira
[x] Link to relevant pull requests, esp. upstream and downstream changes
[x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Fix for DP-1504: review ZMQ client classes
review code in zmq module:
added tests of those ZMQ classes using a simple server and multiple types of clients sending requests synchronously, asynchronously, with lock, without lock, with response required or not, etc ...
Bugfix:
[ERROR][2024-05-24 11:59:40][zmq_client][send][116]: AsyncZMQClient failed to send message, got exception of type Socket operation on non-socket
instrumented code looped on :[WARNING][2024-05-24 12:32:49][zmq_client][handle_socket_errors][88]: ZMQ socket error: tcp://message-server:9000 got exception: Socket operation on non-socket.
TODO:
[Method 'forward_request' was expected to be 'non-async', found it instead as 'async' (invalid-overridden-method)](https://sonarcloud.io/project/issues?pullRequest=156&open=AY-nrWP_VkCPe5gxPlk6&id=MOV-AI_movai-core-shared)