Commit 3d84f82a authored by Jason Madden's avatar Jason Madden

Quiet lookup errors from the threadpool by default. Ref #617 that was also...

Quiet lookup errors from the threadpool by default. Ref #617 that was also mentioned in a private email.
parent a3a1d169
......@@ -398,6 +398,7 @@ class Hub(greenlet):
#: Instances of these classes are not considered to be errors and
#: do not get logged/printed when raised by the event loop.
NOT_ERROR = (GreenletExit, SystemExit)
loop_class = config('gevent.core.loop', 'GEVENT_LOOP')
resolver_class = ['gevent.resolver_thread.Resolver',
'gevent.resolver_ares.Resolver',
......
......@@ -40,6 +40,10 @@ class Resolver(object):
if hub is None:
hub = get_hub()
self.pool = hub.threadpool
if _socket.gaierror not in hub.NOT_ERROR:
# Do not cause lookup failures to get printed by the default
# error handler. This can be very noisy.
hub.NOT_ERROR += (_socket.gaierror, _socket.herror)
def __repr__(self):
return '<gevent.resolver_thread.Resolver at 0x%x pool=%r>' % (id(self), self.pool)
......
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