swift/test/unit
Alistair Coles dc3eda7e89 proxy: don't send multi-part terminator when no parts sent
If the proxy timed out while reading a replicated policy multi-part
response body, it would transform the ChunkReadTimeout to a
StopIteration. This masks the fact that the backend read has
terminated unexpectedly. The document_iters_to_multipart_byteranges
would complete iterating over parts and send a multipart terminator
line, even though no parts may have been sent.

This patch removes the conversion of ChunkReadTmeout to StopIteration.
The ChunkReadTimeout that is now raised prevents the
document_iters_to_multipart_byteranges 'for' loop completing and
therefore stops the multi-part terminator line being sent. It is
raised from the GetOrHeadHandler similar to other scenarios that raise
ChunkReadTimeouts while the resp body is being read.

A ChunkReadTimeout exception handler is removed in the
_iter_parts_from_response method. This handler was previously never
reached (because StopIteration rather than ChunkReadTimeout was raised
from _get_next_response_part), but if it were reached (i.e. with this
change) then it would repeat logging of the error and repeat
incrementing the node's error counter.

This change in the GetOrHeadHandler mimics a similar change in the
ECFragGetter [1].

[1] Related-Chage: I0654815543be3df059eb2875d9b3669dbd97f5b4
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Change-Id: I6dd53e239f5e7eefcf1c74229a19b1df1c989b4a
2024-02-05 10:28:40 +00:00
..
account Remove per-service auto_create_account_prefix 2023-11-22 01:58:03 +09:00
cli cli: add --sync to db info to show syncs 2024-01-16 08:19:08 -08:00
common Update malformed_example.db to actually be malformed 2024-01-25 04:37:04 +00:00
container Proxy: Use namespaces when getting listing/updating shards 2024-01-11 10:46:53 +00:00
obj Work with latest eventlet (again) 2024-01-16 15:12:37 -08:00
proxy proxy: don't send multi-part terminator when no parts sent 2024-02-05 10:28:40 +00:00
test_locale py3: port the test of locale 2019-06-19 09:54:14 -07:00
__init__.py proxy: don't send multi-part terminator when no parts sent 2024-02-05 10:28:40 +00:00
helpers.py Unit test for keepalive timeout 2023-05-10 09:01:41 -07:00