Follow up for change Ibbc89449e7878fc4215e47e3f7dfe4ae58a2d638
to add a test assertion that the ChunkWriteTimeout contexts are
exited without raising the timeout exception in
iter_bytes_from_response_part().
Change-Id: I6d323cb26779e457fb5940093a81b349b333a0af
When direct_client.direct_get_suffix_hashes raises a
DirectClientException the exception message and variables
should report the replication_ip and replication_port, as
opposed to the ip and port values reported for all other
case when the exception is raised.
Add option to override ip and port reported in
DirectClientException.
Also adds unit tests to verify both cases.
Related-Bug: 1566395
Change-Id: If3d952847c7199f4e9f6164858085367266386d2
This is a follow-up patch for https://review.openstack.org/#/c/258392/
That one added good unit test cases for various kinds of
allowe_origin like '*' or ''(empty). However, the result of handling
in Swift proxy will depend on strict_cors_mode option configuration.
This patch refactors the unit tests to split out for
strict_cors_mode = on/off and add some missing unit tests for
each case.
Change-Id: I55f7cd279436b5c9f71d81fecf06021380e35579
direct_client.direct_get_suffix_hashes doesn't use replication ip and
port for REPLICATE request. Since we have an option of doing
replication in separate network, we can add replication_ip and port
while creating rings if not it will get filled in with the regular
node's ip.
Change-Id: I34067df27042fc3146b795191ab8043ee1aed3ce
Closes-Bug:1566395
Previously, versioned_writes assumed that all container servers would
always have the latest Swift code, allowing them to return reversed
listings. This could cause the wrong version of a file to be restored
during rolling upgrades.
Now, versioned_writes will check that the listing returned is actually
reversed. If it isn't, we will revert to getting the full (in-order)
listing of versions and reversing it on the proxy.
Change-Id: Ib53574ff71961592426cb386ef00a75eb5824def
Closes-Bug: 1562083
_validate_policy_name always either returns True or raises an exception.
Simplify it to just being a callable that may raise an exception.
Also, move the check for blank/None names into _validate_policy_name, so
it will be applied in more cases.
Change-Id: I7832a0c9c895cd75ba4c6d0e8b5568a3c8a0ea25
When eventlet.wsgi closes an ECAppIter on client disconnect we need to
make sure our sub-iterators are also closed. We already kill the
backend sockets, but the executing contexts are left running until
they timeout. A slow client can result in needlessly holding queued
backend fragments until the client_timeout (default 60s).
Update associated test that exposed the problem to demonstrate the
issue more quickly.
Change-Id: Ibbc89449e7878fc4215e47e3f7dfe4ae58a2d638
Content-Disposition headers should make no difference between
GET and HEAD according to HTTP rfc.
Closes-Bug: #1539805
Change-Id: Ifa41a7cda2f321eb8e36420ede7912ed0a549712
Follow up for change [1] to add some assertions to check that
marker param is included in sequential GET requests sent during
a full listing.
Extract multiple FakeConn class definitions to single class at
module level and share between all classes.
Also, explicitly unpack the return values from base request calls
made in the full listing section of base_request, and explicitly
return a list to make more consistent with rest of the method.
[1] Change-Id: I6892390d72f70f1bc519b482d4f72603e1570163
Change-Id: Iad038709f46364b8324d25ac79be4317add79df5
The internal_client is used in swift-dispersion-report, and in case one has more
than 10000 containers or objects these are not queried.
This patch adds support to the internal_client to iterate over all
containers/objects if the listing exceeds the default of 10000 entries and the
argument full_listing=True is used.
Closes-Bug: 1314817
Closes-Bug: 1525995
Change-Id: I6892390d72f70f1bc519b482d4f72603e1570163