Commit 413b7472 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix locking bug causing high CPU usage

Iustin Pop noticed unusually high CPU usage with 2.1's master
daemon, even with very simple opcodes like OP_TEST_DELAY. As
it turns out, we inadvertently passed seconds as milliseconds
to a call to poll(2). Due to the way the loop around the call
works it didn't break competely, but caused higher CPU usage
by the poll(2) call returning too early.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent f3448a3c
......@@ -145,7 +145,8 @@ class _SingleNotifyPipeConditionWaiter(object):
result = self._poller.poll(remaining_time)
# Our calculation uses seconds, poll() wants milliseconds
result = self._poller.poll(1000 * remaining_time)
except EnvironmentError, err:
if err.errno != errno.EINTR:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment