swift/swift/common
Darrell Bishop 1107f24179 Seamlessly reload servers with SIGUSR1
Swift servers can now be seamlessly reloaded by sending them a SIGUSR1
(instead of a SIGHUP).  The server forks off a synchronized child to
wait to close the old listen socket(s) until the new server has started
up and bound its listen socket(s).  The new server is exec'ed from the
old one so its PID doesn't change.  This makes Systemd happier, so a
ReloadExec= stanza can now be used.

The seamless part means that incoming connections will alwyas get
accepted either by the old server or the new one.  This eliminates
client-perceived "downtime" during server reloads, while allowing the
server to fully reload, re-reading configuration, becoming a fresh
Python interpreter instance, etc.  The SO_REUSEPORT socket option has
already been getting used, so nothing had to change there.

This patch also includes a non-invasive fix for a current eventlet bug;
see https://github.com/eventlet/eventlet/pull/590
That bug prevents a SIGHUP "reload" from properly servicing existing
requests before old worker processes close sockets and exit.  The
existing probtests missed this, but the new ones, in this patch, caught
it.

New probe tests cover both old SIGHUP "reload" behavior as well as the
new SIGUSR1 seamless reload behavior.

Change-Id: I3e5229d2fb04be67e53533ff65b0870038accbb7
2019-11-07 10:15:26 -08:00
..
middleware Merge "Use `==` to compare against the empty string, not `is`" 2019-10-15 22:56:44 +00:00
ring py38: Provide readinto() interface for RingReader 2019-10-14 18:00:11 -07:00
__init__.py Start using Hacking 2013-07-15 11:41:58 +02:00
base_storage_server.py Make log format for requests configurable 2019-05-02 17:43:25 -06:00
bufferedhttp.py bufferedhttp: ensure query params are properly quoted 2019-09-12 11:48:03 -07:00
constraints.py Allow bulk delete of big SLO manifests 2019-08-13 16:51:50 -07:00
container_sync_realms.py Python3: Fix test/unit/common/test_container_sync_realms.py 2019-01-29 09:04:36 -06:00
daemon.py Seamlessly reload servers with SIGUSR1 2019-11-07 10:15:26 -08:00
db.py py3: Specify an encoding when loading db.pending pickles 2019-06-17 08:06:39 -07:00
db_replicator.py container-replicator: Add a timeout for get_shard_ranges 2019-07-03 22:29:47 -07:00
direct_client.py py3: Monkey-patch json.loads to accept bytes on py35 2018-11-02 21:38:53 +00:00
exceptions.py Fix socket leak on object-server death 2019-01-31 18:38:35 +00:00
header_key_dict.py py3: Fix title-casing in HeaderKeyDict 2019-07-25 12:55:03 -07:00
http.py Fix pep8 E265 warning of hacking 0.10 2015-07-30 09:33:18 +02:00
internal_client.py Add params to get_*_metadata internal client methods 2019-08-14 16:13:25 +02:00
linkat.py py3: port common/ring/ and common/utils.py 2018-02-12 06:42:24 +00:00
manager.py Seamlessly reload servers with SIGUSR1 2019-11-07 10:15:26 -08:00
memcached.py py3: add swift-dsvm-functional-py3 job 2019-06-21 22:31:18 -07:00
request_helpers.py Consolidate Container-Update-Override headers 2019-08-09 10:35:26 -05:00
splice.py Clean out Python 2.6 leftovers from splice.py 2018-05-24 11:44:49 -07:00
storage_policy.py py3: Make StoragePolicy objects hashable 2019-05-04 21:01:29 -07:00
swob.py Consistently use io.BytesIO 2019-10-15 15:09:46 +02:00
utils.py Seamlessly reload servers with SIGUSR1 2019-11-07 10:15:26 -08:00
wsgi.py Seamlessly reload servers with SIGUSR1 2019-11-07 10:15:26 -08:00