<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/python-swiftclient.git/swiftclient/service.py, branch stable/ussuri</title>
<subtitle>opendev.org: openstack/python-swiftclient.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/'/>
<entry>
<title>Delete/overwrite symlinks better</title>
<updated>2019-08-02T03:42:31+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2019-07-27T05:56:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=78753987468cb6b04d0b4e06b432e22f5a7189bd'/>
<id>78753987468cb6b04d0b4e06b432e22f5a7189bd</id>
<content type='text'>
Previously, when deleting a symlink that points to an xLO, we'd clean
up the xLO's segments then delete the symlink, leaving the xLO itself
busted.

Similar trouble would come from overwriting a symlink pointing to an
xLO. Check for a Content-Location in the HEAD response and leave such
segments.

Co-Authored-By: Clay Gerrard &lt;clay.gerrard@gmail.com&gt;
Change-Id: I45b210cf380a68bd88187c91fa2d63a8b2bb709b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, when deleting a symlink that points to an xLO, we'd clean
up the xLO's segments then delete the symlink, leaving the xLO itself
busted.

Similar trouble would come from overwriting a symlink pointing to an
xLO. Check for a Content-Location in the HEAD response and leave such
segments.

Co-Authored-By: Clay Gerrard &lt;clay.gerrard@gmail.com&gt;
Change-Id: I45b210cf380a68bd88187c91fa2d63a8b2bb709b
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Clean up warnings from newer flake8"</title>
<updated>2019-06-28T08:13:46+00:00</updated>
<author>
<name>Zuul</name>
<email>zuul@review.opendev.org</email>
</author>
<published>2019-06-28T08:13:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=4b3e33b3c28892616d42cf3f1497dd8db63c783b'/>
<id>4b3e33b3c28892616d42cf3f1497dd8db63c783b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix SLO re-upload</title>
<updated>2019-06-28T04:45:10+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2019-04-10T23:22:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=9021a58c240e156f54ffafdc4609868f348d3ebc'/>
<id>9021a58c240e156f54ffafdc4609868f348d3ebc</id>
<content type='text'>
Previously, if you uploaded a file as an SLO then re-uploaded it
with the same segment size and mtime, the second upload would
go delete the segments it just (re)uploaded. This was due to
us tracking old_slo_manifest_paths and new_slo_manifest_paths
in different formats; one would have a leading slash while the
other would not.

Now, normalize to the stripped-slash version so we stop deleting
segments we just uploaded.

Change-Id: Ibcbed3df4febe81cdf13855656e2daaca8d521b4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if you uploaded a file as an SLO then re-uploaded it
with the same segment size and mtime, the second upload would
go delete the segments it just (re)uploaded. This was due to
us tracking old_slo_manifest_paths and new_slo_manifest_paths
in different formats; one would have a leading slash while the
other would not.

Now, normalize to the stripped-slash version so we stop deleting
segments we just uploaded.

Change-Id: Ibcbed3df4febe81cdf13855656e2daaca8d521b4
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up warnings from newer flake8</title>
<updated>2019-06-28T04:43:46+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2019-06-25T22:25:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=3b21157a844be5b71fba2216486c3ef412e7ae1a'/>
<id>3b21157a844be5b71fba2216486c3ef412e7ae1a</id>
<content type='text'>
Change-Id: I18a6327b3acdd4db5ae80097080c043f7c20c353
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I18a6327b3acdd4db5ae80097080c043f7c20c353
</pre>
</div>
</content>
</entry>
<entry>
<title>Make proper functions instead of assigning lambdas</title>
<updated>2019-02-21T17:26:32+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2019-02-21T17:26:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=0ee7c8272e0de2d8c44fd98306d54fc290d74f38'/>
<id>0ee7c8272e0de2d8c44fd98306d54fc290d74f38</id>
<content type='text'>
Change-Id: I89255f6923c649c7b9d3d36e96c09f8bc4f51a3c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I89255f6923c649c7b9d3d36e96c09f8bc4f51a3c
</pre>
</div>
</content>
</entry>
<entry>
<title>Update hacking version</title>
<updated>2019-01-03T05:09:22+00:00</updated>
<author>
<name>ZhijunWei</name>
<email>wzj334965317@outlook.com</email>
</author>
<published>2018-12-28T15:04:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=2ff36fde575fa6987ee5954f526ad6c9460633a5'/>
<id>2ff36fde575fa6987ee5954f526ad6c9460633a5</id>
<content type='text'>
1. update hacking version to latest
2. fix pep8 failed

Change-Id: Ifc3bfeff4038c93d8c8cf2c9d7814c3003e73504
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. update hacking version to latest
2. fix pep8 failed

Change-Id: Ifc3bfeff4038c93d8c8cf2c9d7814c3003e73504
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Treat 404 as success when deleting segments"</title>
<updated>2018-07-12T01:46:49+00:00</updated>
<author>
<name>Zuul</name>
<email>zuul@review.openstack.org</email>
</author>
<published>2018-07-12T01:46:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=25e23988b3be622d51c651f6db339594da01501b'/>
<id>25e23988b3be622d51c651f6db339594da01501b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add force auth retry mode in swiftclient</title>
<updated>2018-03-13T03:29:48+00:00</updated>
<author>
<name>Kota Tsuyuzaki</name>
<email>tsuyuzaki.kota@lab.ntt.co.jp</email>
</author>
<published>2018-03-12T08:54:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=e65070964c7b1e04119c87e5f344d39358780d18'/>
<id>e65070964c7b1e04119c87e5f344d39358780d18</id>
<content type='text'>
This patch attemps to add an option to force get_auth call while retrying
an operation even if it gets errors other than 401 Unauthorized.

Why we need this:
The main reason why we need this is current python-swiftclient requests could
never get succeeded under certion situation using third party proxies/load balancers
between the client and swift-proxy server. I think, it would be general situation
of the use case.

Specifically describing nginx case, the nginx can close the socket from the client
when the response code from swift is not 2xx series. In default, nginx can wait the
buffers from the client for a while (default 30s)[1] but after the time past, nginx
will close the socket immediately. Unfortunately, if python-swiftclient has still been
sending the data into the socket, python-swiftclient will get socket error (EPIPE,
BrokenPipe). From the swiftclient perspective, this is absolutely not an auth error,
so current python-swiftclient will continue to retry without re-auth.
However, if the root cause is sort of 401 (i.e. nginx got 401 unauthorized from the
swift-proxy because of token expiration), swiftclient will loop 401 -&gt; EPIPE -&gt; 401...
until it consume the max retry times.

In particlar, less time to live of the token and multipart object upload with large
segments could not get succeeded as below:

Connection Model:

python-swiftclient -&gt; nginx -&gt; swift-proxy -&gt; swift-backend

Case: Try to create slo with large segments and the auth token expired with 1 hour

1. client create a connection to nginx with successful response from swift-proxy and its auth
2. client continue to put large segment objects
   (e.g. 1~5GB for each and the total would 20~30GB, i.e. 20~30 segments)
3. after some of segments uploaded, 1 hour past but client is still trying to
   send remaining segment objects.
4. nginx got 401 from swift-proxy for a request and wait that the connection is closed
   from the client but timeout past because the python-swiftclient is still sending much data
   into the socket before reading the 401 response.
5. client got socket error because nginx closed the connection during sending the buffer.
6. client retries a new connection to nginx without re-auth...

&lt;loop 4-6&gt;

7. finally python-swiftclient failed with socket error (Broken Pipe)

In operational perspective, setting longer timeout for lingering close would be an option but
it's not complete solution because any other proxy/LB may not support the options.

If we actually do THE RIGHT THING in python-swiftclient, we should send expects: 100-continue
header and handle the first response to re-auth correctly.

HOWEVER, the current python's httplib and requests module used by python-swiftclient doesn't
support expects: 100-continue header [2] and the thread proposed a fix [3] is not super active.
And we know the reason we depends on the library is to fix a security issue that existed
in older python-swiftclient [4] so that we should touch around it super carefully.

In the reality, as the hot fix, this patch try to mitigate the unfortunate situation
described above WITHOUT 100-continue fix, just users can force to re-auth when any errors
occurred during the retries that can be accepted in the upstream.

1: http://nginx.org/en/docs/http/ngx_http_core_module.html#lingering_close
2: https://github.com/requests/requests/issues/713
3: https://bugs.python.org/issue1346874
4: https://review.openstack.org/#/c/69187/

Change-Id: I3470b56e3f9cf9cdb8c2fc2a94b2c551927a3440
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch attemps to add an option to force get_auth call while retrying
an operation even if it gets errors other than 401 Unauthorized.

Why we need this:
The main reason why we need this is current python-swiftclient requests could
never get succeeded under certion situation using third party proxies/load balancers
between the client and swift-proxy server. I think, it would be general situation
of the use case.

Specifically describing nginx case, the nginx can close the socket from the client
when the response code from swift is not 2xx series. In default, nginx can wait the
buffers from the client for a while (default 30s)[1] but after the time past, nginx
will close the socket immediately. Unfortunately, if python-swiftclient has still been
sending the data into the socket, python-swiftclient will get socket error (EPIPE,
BrokenPipe). From the swiftclient perspective, this is absolutely not an auth error,
so current python-swiftclient will continue to retry without re-auth.
However, if the root cause is sort of 401 (i.e. nginx got 401 unauthorized from the
swift-proxy because of token expiration), swiftclient will loop 401 -&gt; EPIPE -&gt; 401...
until it consume the max retry times.

In particlar, less time to live of the token and multipart object upload with large
segments could not get succeeded as below:

Connection Model:

python-swiftclient -&gt; nginx -&gt; swift-proxy -&gt; swift-backend

Case: Try to create slo with large segments and the auth token expired with 1 hour

1. client create a connection to nginx with successful response from swift-proxy and its auth
2. client continue to put large segment objects
   (e.g. 1~5GB for each and the total would 20~30GB, i.e. 20~30 segments)
3. after some of segments uploaded, 1 hour past but client is still trying to
   send remaining segment objects.
4. nginx got 401 from swift-proxy for a request and wait that the connection is closed
   from the client but timeout past because the python-swiftclient is still sending much data
   into the socket before reading the 401 response.
5. client got socket error because nginx closed the connection during sending the buffer.
6. client retries a new connection to nginx without re-auth...

&lt;loop 4-6&gt;

7. finally python-swiftclient failed with socket error (Broken Pipe)

In operational perspective, setting longer timeout for lingering close would be an option but
it's not complete solution because any other proxy/LB may not support the options.

If we actually do THE RIGHT THING in python-swiftclient, we should send expects: 100-continue
header and handle the first response to re-auth correctly.

HOWEVER, the current python's httplib and requests module used by python-swiftclient doesn't
support expects: 100-continue header [2] and the thread proposed a fix [3] is not super active.
And we know the reason we depends on the library is to fix a security issue that existed
in older python-swiftclient [4] so that we should touch around it super carefully.

In the reality, as the hot fix, this patch try to mitigate the unfortunate situation
described above WITHOUT 100-continue fix, just users can force to re-auth when any errors
occurred during the retries that can be accepted in the upstream.

1: http://nginx.org/en/docs/http/ngx_http_core_module.html#lingering_close
2: https://github.com/requests/requests/issues/713
3: https://bugs.python.org/issue1346874
4: https://review.openstack.org/#/c/69187/

Change-Id: I3470b56e3f9cf9cdb8c2fc2a94b2c551927a3440
</pre>
</div>
</content>
</entry>
<entry>
<title>Treat 404 as success when deleting segments</title>
<updated>2018-01-26T22:14:18+00:00</updated>
<author>
<name>Tim Burke</name>
<email>tim.burke@gmail.com</email>
</author>
<published>2018-01-26T22:14:18+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=2901e1e9ef1932b0b3874e608422bbfdfbd1448a'/>
<id>2901e1e9ef1932b0b3874e608422bbfdfbd1448a</id>
<content type='text'>
Change-Id: I76be70ddb289bd4f1054a684a247279ab16ca34a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I76be70ddb289bd4f1054a684a247279ab16ca34a
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow for object uploads &gt; 5GB from stdin.</title>
<updated>2018-01-18T04:56:12+00:00</updated>
<author>
<name>Timur Alperovich</name>
<email>timuralp@swiftstack.com</email>
</author>
<published>2017-06-28T19:02:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/python-swiftclient.git/commit/?id=2faea932870956583f83226886d33304ee1eee46'/>
<id>2faea932870956583f83226886d33304ee1eee46</id>
<content type='text'>
When uploading from standard input, swiftclient should turn the upload
into an SLO in the case of large objects. This patch picks the
threshold as 10MB (and uses that as the default segment size). The
consumers can also supply the --segment-size option to alter that
threshold and the SLO segment size. The patch does buffer one segment
in memory (which is why 10MB default was chosen).

(test is updated)

Change-Id: Ib13e0b687bc85930c29fe9f151cf96bc53b2e594
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When uploading from standard input, swiftclient should turn the upload
into an SLO in the case of large objects. This patch picks the
threshold as 10MB (and uses that as the default segment size). The
consumers can also supply the --segment-size option to alter that
threshold and the SLO segment size. The patch does buffer one segment
in memory (which is why 10MB default was chosen).

(test is updated)

Change-Id: Ib13e0b687bc85930c29fe9f151cf96bc53b2e594
</pre>
</div>
</content>
</entry>
</feed>
