swift/swift
Samuel Merritt 6b4e6aeffa Fix deadlock when logging from a tpool thread.
The object server runs certain IO-intensive methods outside the main
pthread for performance. If one of those methods tries to log, this can
cause a crash that eventually leads to an object server with hundreds
or thousands of greenthreads, all deadlocked.

The short version of the story is that logging.SysLogHandler has a
mutex which Eventlet monkey-patches. However, the monkey-patched mutex
sometimes breaks if used across different pthreads, and it breaks in
such a way that it is still considered held. After that happens, any
attempt to emit a log message blocks the calling greenthread forever.

The fix is to use a mutex that works across different greenlets and
across different pthreads. This patch introduces such a lock based on
an anonymous pipe.

Change-Id: I57decefaf5bbed57b97a62d0df8518b112917480
Closes-Bug: 1710328
(cherry picked from commit 6d160797fc)
2017-09-12 18:54:09 -04:00
..
account Merge "py3: Fixes encoding and type error" 2016-09-05 13:18:24 +00:00
cli Rebalance with min_part_seconds_left > 0 2017-02-14 11:21:21 +01:00
common Fix deadlock when logging from a tpool thread. 2017-09-12 18:54:09 -04:00
container Correct swift reraising of exception 2016-09-01 02:25:29 +00:00
locale Imported Translations from Zanata 2016-11-22 07:50:26 +00:00
obj Fix race when consolidating new partition 2017-05-15 12:24:01 -07:00
proxy Enable object server to return non-durable data 2016-09-16 11:40:14 +01:00
__init__.py Make pbr a build-time only dependency 2013-10-29 12:29:49 -07:00