Fixes #74, removing filenos from the hub when they raise a value error, thanks to Edward George for the repro and fix.
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -67,3 +67,4 @@ Thanks To
|
|||||||
* Malcolm Cleaton, patch for Event exception handling
|
* Malcolm Cleaton, patch for Event exception handling
|
||||||
* Alexey Borzenkov, for finding and fixing issues with Windows error detection (#66, #69), reducing dependencies in zeromq hub (#71)
|
* Alexey Borzenkov, for finding and fixing issues with Windows error detection (#66, #69), reducing dependencies in zeromq hub (#71)
|
||||||
* Anonymous, finding and fixing error in websocket chat example (#70)
|
* Anonymous, finding and fixing error in websocket chat example (#70)
|
||||||
|
* Edward George, finding and fixing an issue in the [e]poll hubs (#74)
|
||||||
|
@@ -38,6 +38,7 @@ class Hub(BaseHub):
|
|||||||
mask |= READ_MASK | EXC_MASK
|
mask |= READ_MASK | EXC_MASK
|
||||||
if self.listeners[WRITE].get(fileno):
|
if self.listeners[WRITE].get(fileno):
|
||||||
mask |= WRITE_MASK | EXC_MASK
|
mask |= WRITE_MASK | EXC_MASK
|
||||||
|
try:
|
||||||
if mask:
|
if mask:
|
||||||
if new:
|
if new:
|
||||||
self.poll.register(fileno, mask)
|
self.poll.register(fileno, mask)
|
||||||
@@ -53,6 +54,10 @@ class Hub(BaseHub):
|
|||||||
# raised if we try to remove a fileno that was
|
# raised if we try to remove a fileno that was
|
||||||
# already removed/invalid
|
# already removed/invalid
|
||||||
pass
|
pass
|
||||||
|
except ValueError:
|
||||||
|
# fileno is bad, issue 74
|
||||||
|
self.remove_descriptor(fileno)
|
||||||
|
raise
|
||||||
|
|
||||||
def remove_descriptor(self, fileno):
|
def remove_descriptor(self, fileno):
|
||||||
super(Hub, self).remove_descriptor(fileno)
|
super(Hub, self).remove_descriptor(fileno)
|
||||||
|
@@ -169,6 +169,7 @@ class TestHubBlockingDetector(LimitedTestCase):
|
|||||||
self.assertRaises(RuntimeError, gt.wait)
|
self.assertRaises(RuntimeError, gt.wait)
|
||||||
debug.hub_blocking_detection(False)
|
debug.hub_blocking_detection(False)
|
||||||
|
|
||||||
|
|
||||||
class TestSuspend(LimitedTestCase):
|
class TestSuspend(LimitedTestCase):
|
||||||
TEST_TIMEOUT=3
|
TEST_TIMEOUT=3
|
||||||
def test_suspend_doesnt_crash(self):
|
def test_suspend_doesnt_crash(self):
|
||||||
@@ -205,6 +206,14 @@ except eventlet.Timeout:
|
|||||||
shutil.rmtree(self.tempdir)
|
shutil.rmtree(self.tempdir)
|
||||||
|
|
||||||
|
|
||||||
|
class TestBadFilenos(LimitedTestCase):
|
||||||
|
@skip_with_pyevent
|
||||||
|
def test_repeated_selects(self):
|
||||||
|
from eventlet.green import select
|
||||||
|
self.assertRaises(ValueError, select.select, [-1], [], [])
|
||||||
|
self.assertRaises(ValueError, select.select, [-1], [], [])
|
||||||
|
|
||||||
|
|
||||||
class Foo(object):
|
class Foo(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user