swift/swift/obj
Samuel Merritt 633998983c Use "poll" or "selects" Eventlet hub for all Swift daemons.
Previously, Swift's WSGI servers, the object replicator, and the
object reconstructor were setting Eventlet's hub to either "poll" or
"selects", depending on availability. Other daemons were letting
Eventlet use its default hub, which is "epoll".

In any daemons that fork, we really don't want to use epoll. Epoll
instances end up shared between the parent and all children, and you
get some awful messes when file descriptors are shared.

Here's an example where two processes are trying to wait on the same
file descriptor using the same epoll instance, and everything goes
wrong:

[proc A] epoll_ctl(6, EPOLL_CTL_ADD, 3, ...) = 0

[proc B] epoll_ctl(6, EPOLL_CTL_ADD, 3, ...) = -1 EEXIST (File exists)
[proc B] epoll_wait(6, ...) = 1
[proc B] epoll_ctl(6, EPOLL_CTL_DEL, 3, ...) = 0

[proc A] epoll_wait(6, ...)

This primarily affects the container updater and object updater since
they fork. I've decided to change the hub for all Swift daemons so
that we don't add multiprocessing support to some other daemon someday
and suffer through this same bug again.

This problem was made more apparent by commit 6d16079, which made our
logging mutex use file descriptors. However, it could have struck on
any shared file descriptor on which a read or write returned EAGAIN.

Change-Id: Ic2c1178ac918c88b0b901e581eb4fab3b2666cfe
Closes-Bug: 1722951
2017-11-01 12:19:04 -07:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
auditor.py Merge "Raise ValueError if a config section does not exist" 2016-12-19 07:30:59 +00:00
diskfile.py Better optimistic lock in get_hashes 2017-01-31 22:14:28 +00:00
expirer.py Move documented reclaim_age option to correct location 2017-01-13 03:10:47 +00:00
mem_diskfile.py Fix typo in docstring 2016-09-28 15:55:25 +07:00
mem_server.py Per-policy DiskFile classes 2015-04-14 00:52:16 -07:00
reconstructor.py Use "poll" or "selects" Eventlet hub for all Swift daemons. 2017-11-01 12:19:04 -07:00
replicator.py Use "poll" or "selects" Eventlet hub for all Swift daemons. 2017-11-01 12:19:04 -07:00
server.py Handle deleted files with if-none-match 2016-11-22 21:06:24 -05:00
ssync_receiver.py Merge "Prevent ssync writing bad fragment data to diskfile" 2016-10-14 23:29:29 +00:00
ssync_sender.py Fix stats calculation in object-reconstructor 2016-12-12 21:26:54 -08:00
updater.py Merge "Fixups for ghost listing fix" 2016-12-09 03:03:03 +00:00