Skip to content

Commit

Permalink
Process all pending receive events
Browse files Browse the repository at this point in the history
The previous version of the code received a single object out of the
socket, even if the poller indicated that there was more than one event
to be read. This is inefficient, as increases the processing times of
events, and probably is what led to our failures in the Travis CI tests.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Jul 3, 2020
1 parent 6842fa3 commit c0c3a4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daliuge-runtime/dlg/manager/node_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ def _receive_events(self, sock_created):
except Queue.Empty:
pass

if self._pubsub_running and poller.poll(100):
if not self._pubsub_running:
break
for _ in poller.poll(100):
self.deliver_event(sub.recv_pyobj())
sub.close()

Expand Down

0 comments on commit c0c3a4f

Please sign in to comment.