From 2f1df7f82d1d04e46d22f1d6be60e707027f1535 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 22 Apr 2018 14:27:41 +0100 Subject: [PATCH] ansible: FileService wasn't sleeping properly. "_schedule_pending" is a function, "_pending_by_stream" is the map we want to test. --- ansible_mitogen/services.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible_mitogen/services.py b/ansible_mitogen/services.py index fee50934..d2cb9355 100644 --- a/ansible_mitogen/services.py +++ b/ansible_mitogen/services.py @@ -420,7 +420,7 @@ class FileService(mitogen.service.Service): #: Time spent by the scheduler thread asleep when it has no more data to #: pump, but while at least one transfer remains active. With #: max_queue_size=1MiB and a sleep of 10ms, maximum throughput on any - #: single stream is 100MiB/sec, which is 5x what SSH can handle on my + #: single stream is 112MiB/sec, which is >5x what SSH can handle on my #: laptop. sleep_delay_ms = 0.01 @@ -500,7 +500,7 @@ class FileService(mitogen.service.Service): :meth:`on_shutdown` hasn't been called yet, otherwise :data:`False`. """ - if self._schedule_pending: + if self._pending_by_stream: timeout = self.sleep_delay_ms else: timeout = None @@ -523,7 +523,7 @@ class FileService(mitogen.service.Service): """ Scheduler thread's main function. Sleep until :meth:`_sleep_on_queue` indicates the queue has been shut down, - pending pending file chunks each time we wake. + pumping pending file chunks each time we wake. """ while self._sleep_on_queue(): for stream, pending in list(self._pending_by_stream.items()):