For Python 2, patching existing locks replaces RLock._RLock__owner with current
thread ID no matter the old lock is locked or not and thus an unlocked RLock
would have a non None owner (e.g. <_RLock owner=140106584489808 count=0>).
Then if we acquire the RLock in the same thread, the method RLock.acquire would
not invoke the _RLock__block.acquire() since it treats this is a recursive
acquire by checking current thread ID. And then the following RLock.release
would invoke the _RLock__block.release method resulting in the counter of
Semaphore being improved to 2.
There should be only two states being expected for RLock:
1. owner != None and count > 0
2. owner == None and count == 0
This patch fixs it by only setting locked RLocks' owner during patching.
Zipkin is a trend distributed tracing framewrok developed at Twitter.
Such tracing is useful for both developers and operatos to
understand the behavior of complex distributed systems
and find performance bottlenecks.
This patch provides a WSGI application using eventlet
with tracing facility that complies with Zipkin.
Signed-off-by: Yuichi Bando <bando.yuichi@lab.ntt.co.jp>
Original commit modified for PEP-8 fixes.
https://github.com/eventlet/eventlet/pull/218
If your code depends on EAI_NODATA, run with EVENTLET_DEPRECATED_EAI_NODATA=yes
during transition to EAI_NONAME.
Support for EAI_NODATA will be removed in future versions.
https://github.com/eventlet/eventlet/issues/393
Sorry for negation in name, perfectionists want EVENTLET_GREEN_DNS=no
but I figured it's lesser evil than reviving same behavior under different name.
This works around https://github.com/eventlet/eventlet/issues/383
at the cost of resolving blocking other greenthreads.
This bug was introduced in v0.20.1
Now the behavior is as expected: first check hosts file, if it contains address - short return without querying nameservers.
https://github.com/eventlet/eventlet/issues/387
Asserting udp for ssh introduce test failures under debian unstable
because netbase 5.4 removed ssh (22/udp).
This fix changes ssh -> domain, which better suit for test name and
allows tcp and udp simultaneously.
`resolv.conf` docs say unqualified names must resolve from search (or local) domain.
However, common OS `getaddrinfo()` implementations append trailing dot (e.g. `db -> db.`)
and ask nameservers, as if top-level domain was queried.
Eventlet now supports this behavior.
https://github.com/eventlet/eventlet/issues/363
Previous PropagateError.__init__() failed to call Exception.__init__() at all.
Moreover, as described in https://bugs.python.org/issue1692335, setting
self.args is important for an Exception subclass with nonstandard constructor
arguments.
When an Exception subclass sets self.args, it makes the subclass pickleable --
but instead of str(instance) returning the string passed to
Exception.__init__(), it instead returns the string representation of
self.args. So capture the message string, and in addition to passing it to
Exception.__init__(), also override __str__() and return the same string.
https://github.com/eventlet/eventlet/pull/359
When calling getaddrinfo with an unspecified address family, we:
* try to get an IPv6 address for the host, first trying /etc/hosts and
failing that, using any external nameserver, then
* try to get an IPv4 address for it, with the same /etc/hosts ->
external nameserver priority.
Note that if the host can be resolved using /etc/hosts but only to one
of the two address families, we still attempt to contact the external
nameserver to resolve it in the other family.
Previously, if this timed out or raised a DNSException other than
NXDOMAIN, EAI_EAGAIN_ERROR or EAI_NODATA_ERROR would be raised even
though we could resolve the host. Now, those errors will only be raised
if neither attempt at resolution succeeded.
https://github.com/eventlet/eventlet/pull/354