10175 Commits

Author SHA1 Message Date
Tim Burke
23fa18d302 Remove hard dependency on netifaces
The project was archived in 2021, and we can fairly easily replace it
with some ctypes code to call getifaddrs ourselves.

Be willing to fall back to netifaces (with a warning) in case getifaddrs
is not available, but I'm fairly certain it will be for all platforms we
support.

Could maybe use some more testing on big-endian arches / BSDs, but an
attempt was at least made at supporting them.

Partial-Bug: #2019233
Change-Id: I1189a60204cf96c291619f8d8ec957ed8a5be1ce
2023-05-23 14:35:48 -07:00
Tim Burke
e29e2c3ae5 Move IP-address-related functions out to new module
Partial-Bug: #2015274
Change-Id: I7ffa3a8e95d4ec456860b0484caf1dd08ff0849a
2023-05-22 10:51:21 -07:00
Zuul
ef64b63fdf Merge "proxy: add periodic zero-time sleep during object PUT" 2023-05-19 23:14:32 +00:00
Zuul
1163c5c8a3 Merge "s3api: Better logging for non-JSON when trying to do bucket listings" 2023-05-19 13:26:27 +00:00
Tim Burke
2deab27dad s3api: Better logging for non-JSON when trying to do bucket listings
Change-Id: Ib79bfd23b7b6f40673396aafa47a0f8c4f533a97
2023-05-19 12:06:08 +01:00
Zuul
dc1e58f3d5 Merge "memcached: encapsulate common command parameters" 2023-05-19 10:43:50 +00:00
Alistair Coles
f714f43c90 memcached: encapsulate common command parameters
Introduce a MemcacheCommand class to encapsulate some of the common
parameters and functionality associated with the MemcacheRing methods.

No behavioural changes.

Change-Id: I2a84d5b74d74967628973ad5d67749b787ba7590
Related-Change: I4d4f20b92b85255ac8bf66f2c830e691e64bbe47
Related-Change: I07491bb4ebc3baa13cf09f64a04a61011d561409
2023-05-19 09:24:44 +01:00
Zuul
eda3b33a65 Merge "tests: Make dark data probe tests pass with sync_method = ssync" 2023-05-18 21:15:25 +00:00
Zuul
68a58b8fe6 Merge "Imported Translations from Zanata" 2023-05-18 20:16:14 +00:00
Alistair Coles
aa96cb3dc6 proxy: add periodic zero-time sleep during object PUT
Previously it was possible for an entire object PUT data transfer to
execute without the greenthread sleeping and allowing other
greenthreads to run. This was more likely with an EC PUT because the
computation of EC fragments might be slower than the rate at which
they are drained out of IO send buffers, so IO never blocks. In
extreme cases this could cause timeouts in other greenthreads to pop.

This patch adds a periodic zero-time sleep in the object PUT data
transfer loop. An existing pattern in the GET path is re-used, and
extracted to a new CooperativeIterator helper class.

Change-Id: Idd6b767f1a746c72c106199f5d1fada3615b1e97
Closes-Bug: #2019955
Related-Change: Iae27109f5a3d109ad21ec9a972e39f22150f6dbb
2023-05-18 12:30:58 -07:00
Zuul
8909604540 Merge "Memcached: emit memcache timing metrics when exceptions raised" 2023-05-18 11:52:53 +00:00
OpenStack Proposal Bot
4bc86ec30e Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Iff1aa6ad636a404cf8149ad3070e28bef48aa527
2023-05-18 03:18:37 +00:00
Zuul
4c7b2e3bb5 Merge "Add cap_length helper" 2023-05-17 23:20:30 +00:00
Zuul
667f733cb9 Merge "memcached: log user provided keys in exception error logging." 2023-05-17 23:20:25 +00:00
Zuul
d098ffd04c Merge "Unit test for keepalive timeout" 2023-05-17 23:20:23 +00:00
Tim Burke
66e6ee6241 tests: Make dark data probe tests pass with sync_method = ssync
Change-Id: Ic94761e435d85a7fe4bd17a7d341b1655b98b3ff
2023-05-17 15:25:22 -07:00
Zuul
a0c5ac29a1 Merge "docs: Remove references to out-dated install guides" 2023-05-17 00:20:06 +00:00
Tim Burke
cff092b682 docs: Update versions in Getting Started doc
Change-Id: Ibed9dc0afbdb922d06f7798bdac01db7c55b19f1
2023-05-16 15:36:00 -07:00
Tim Burke
ca0dd8d703 docs: Remove references to out-dated install guides
Change-Id: Idbff951506ee2f3b288eda00217c902314393877
2023-05-16 15:31:13 -07:00
Zuul
e6792bccef Merge "testing xattr metadata with py3.8" 2023-05-15 08:23:40 +00:00
Zuul
e6203384c2 Merge "Properly read py2 object metadata on py3" 2023-05-15 08:23:37 +00:00
Zuul
8f84aef700 Merge "disable requests_mock pytest plugin" 2023-05-12 19:57:03 +00:00
Clay Gerrard
9adc3ce425 disable requests_mock pytest plugin
While we use requests-mock, we don't need the pytest plugin.

Change-Id: If14e4d2c1af2efcbc99e9b6fe10973a7eb94d589
2023-05-10 14:45:33 -07:00
Jianjian Huo
7b4642567a Memcached: emit memcache timing metrics when exceptions raised
Below new metrics will be added:
memcached.[method].timeout.timing
memcached.[method].conn_err.timing
memcached.[method].errors.timing

Also, MemcacheRing method and time spent in the function will
be logged when Timeout or other exceptions are raised.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I4d4f20b92b85255ac8bf66f2c830e691e64bbe47
2023-05-10 13:27:58 -07:00
Shreeya Deshpande
647ee83906 Unit test for keepalive timeout
Create a unit test to verify client timeout for multiple requests

Change-Id: I974e01cd2cb18f4ea87c3966dbf4b06bff22ed39
2023-05-10 09:01:41 -07:00
Zuul
5c2adc593e Merge "Sharder: add timing metrics for individual steps and total time spent." 2023-05-10 07:49:15 +00:00
Zuul
9baf1d623f Merge "more explicit catch" 2023-05-09 23:54:09 +00:00
Zuul
b669e32981 Merge "backend_ratelimit: Tighten blanket exception handling" 2023-05-09 21:51:48 +00:00
Clay Gerrard
01a998a451 more explicit catch
Change-Id: I9fdc74d26fd830f463c077c912cdcf00eaab1dfa
2023-05-09 15:32:02 -05:00
Zuul
89e2050d7f Merge "wsgi: Add keepalive_timeout option" 2023-05-09 02:56:09 +00:00
Tim Burke
9d98721e7c backend_ratelimit: Tighten blanket exception handling
As it was, it would hide issues in the logging or ratelimiter
implementations.

Change-Id: I9e557442401ef17b753f45b9e1cb181e71784ccf
2023-05-05 12:27:01 -07:00
Jianjian Huo
744e9a94af Sharder: add timing metrics for individual steps and total time spent.
Change-Id: Ie2a8e4eced6688e5a98aa37c3c7b0c13fd2ddeee
2023-05-03 22:12:26 -07:00
Clay Gerrard
d393fa482a testing xattr metadata with py3.8
Change-Id: Ib3c9b274bbd2e643f3febbdf54a8a43f4775944b
2023-05-02 17:12:18 -05:00
Tim Burke
7807540962 Properly read py2 object metadata on py3
Replicated, unencrypted metadata is written down differently on py2
vs py3, and has been since we started supporting py3. Fortunately,
we can inspect the raw xattr bytes to determine whether the pickle
was written using py2 or py3, so we can properly read legacy py2 meta
under py3 rather than hitting a unicode error.

Closes-Bug: #2012531
Change-Id: I5876e3b88f0bb1224299b57541788f590f64ddd4
2023-05-02 13:20:03 -07:00
Jianjian Huo
9fb860880d memcached: log user provided keys in exception error logging.
User provided keys are need to debug those tracebacks/timeouts when
clients talking to memcached, in order to associate those failures
with specific memcache usages within swift services.

Change-Id: I07491bb4ebc3baa13cf09f64a04a61011d561409
2023-05-01 11:03:34 -07:00
Zuul
f99a6e5762 Merge "Log (Watchdog's) Timeouts with duration" 2023-05-01 06:27:27 +00:00
Zuul
b1dc6237c1 Merge "Don't monkey patch logging on import" 2023-04-28 22:44:29 +00:00
Zuul
e2682f4a83 Merge "Proxy: restructure cached listing shard ranges" 2023-04-28 22:44:26 +00:00
Zuul
38f1f2d33e Merge "proxy controller: always pass x-backend-* headers to backend" 2023-04-28 22:44:20 +00:00
Zuul
f9493d51f7 Merge "ECFragGetter: assume policy.fragment_size is non-zero" 2023-04-28 21:26:33 +00:00
Zuul
6f62758413 Merge "Make all config parsing case-sensitive" 2023-04-28 18:36:12 +00:00
Zuul
04082fe6fd Merge "ring: Centralize device normalization" 2023-04-28 17:36:37 +00:00
Chetan Mishra
84b995f275 Don't monkey patch logging on import
Previously swift.common.utils monkey patched logging.thread,
logging.threading, and logging._lock upon import with eventlet
threading modules, but that is no longer reasonable or necessary.

With py3, the existing logging._lock is not patched by eventlet,
unless the logging module is reloaded. The existing lock is not
tracked by the gc so would not be found by eventlet's
green_existing_locks().

Instead we group all monkey patching into utils function and apply
patching consistently across daemons and WSGI servers.

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Closes-Bug: #1380815
Change-Id: I6f35ad41414898fb7dc5da422f524eb52ff2940f
2023-04-28 08:57:35 -07:00
Clay Gerrard
8d23dd8ac6 Log (Watchdog's) Timeouts with duration
... and clean up WatchDog start a little.

If this pattern proves useful we could consider extending it.

Change-Id: Ia85f9321b69bc4114a60c32a7ad082cae7da72b3
2023-04-28 10:14:01 -05:00
Clay Gerrard
ab03e057d7 Make all config parsing case-sensitive
This effects both daemon config parsing and paste-deploy config parsing
when using conf.d.  When the WSGI servers were loaded from a flat file
they have always been case-sensitive.  This difference was surprising
(who wants anything case-insensitive?) and potentially dangerous for
values like RECLAIM_AGE.

UpgradeImpact:

Previously the option keys in swift's configuration .ini files were
sometimes parsed in a case-insensitive manner, so you could use
CLIENT_TIMEOUT and the daemons would recognize you meant client_timeout.
Now upper-case or mixed-case option names, such as CLIENT_TIMEOUT or
Client_Timeout, will be ignored.

Change-Id: Idd8e552d9fe98b84d7cee1adfa431ea3ae93345d
2023-04-28 10:03:59 -05:00
Zuul
b61602b70c Merge "docs: Fix broken paste/pastedeploy links" 2023-04-28 11:37:10 +00:00
Zuul
80770eb57b Merge "tests: Fix config numbers in test_versioning_with_metadata_replication" 2023-04-28 11:37:07 +00:00
Zuul
31e51b3f85 Merge "Error logs changed for ChunkWriteTimeout" 2023-04-28 11:37:04 +00:00
Shreeya Deshpande
9dfbac7c4d Error logs changed for ChunkWriteTimeout
The log message phrase 'ChunkWriteTimeout fetching fragments'
implies that the timeout has occurred
while getting a fragment (from the backend object server)
when in fact the timeout has occurred
waiting to yield the fragment to the app iter.
Hence, changing message to 'ChunkWriteTimeout feeding fragments'

Change-Id: Ic0813e6a9844da1130091d27e3dbe272ea871d11
2023-04-27 23:21:04 +00:00
Tim Burke
88941ebe46 tests: Fix config numbers in test_versioning_with_metadata_replication
Closes-Bug: #2017021
Change-Id: If422f99a77245b35ab755857f9816c1e401a4e22
2023-04-27 15:20:07 -07:00