jenkins-bot has submitted this change and it was merged.
Change subject: RCStream: Ignore changes after total is reached ......................................................................
RCStream: Ignore changes after total is reached
There could be 'on_change' messages queued that are still processed before the thread fully shuts down. This prevents those messages from appearing in the queue.
As far as I know, the message pump is single threaded, so the previous on_change call is guaranteed to finish before the next one is called.
Bug: T85716 Change-Id: Ibe6aba6a42028568dbd956da14168fec1bbd920e --- M pywikibot/comms/rcstream.py 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/rcstream.py b/pywikibot/comms/rcstream.py index 688e0f6..fb310f9 100644 --- a/pywikibot/comms/rcstream.py +++ b/pywikibot/comms/rcstream.py @@ -83,6 +83,9 @@ class RCListener(socketIO_client.BaseNamespace): def on_change(self, change): debug('Received change %r' % change, _logger) + if not thread.running: + debug('Thread in shutdown mode; ignoring change.', _logger) + return
thread.count += 1 thread.queue.put(change)
pywikibot-commits@lists.wikimedia.org