fetcher/curl: Stop using CURLOPT_LOW_SPEED_TIME/_LIMIT
authorColin Walters <walters@verbum.org>
Mon, 27 Nov 2017 16:05:07 +0000 (11:05 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 27 Nov 2017 22:31:22 +0000 (22:31 +0000)
They don't play nicely currently with HTTP2 where we may
have lots of requests queued.

https://github.com/ostreedev/ostree/issues/878#issuecomment-347228854

In practice anyways I think issues here are better solved on a higher level -
e.g. apps today can use an overall timeout on pulls and if they exceed the limit
set the cancellable.

Closes: #1349
Approved by: jlebon

src/libostree/ostree-fetcher-curl.c
tests/test-pull-mirrorlist.sh

index 8a23b16361efbd11291e2acee2d2508eb67608ba..58835529dc03442257a510c20b46f42bcdc35988 100644 (file)
@@ -788,8 +788,13 @@ initiate_next_curl_request (FetcherRequest *req,
   curl_easy_setopt (req->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
   curl_easy_setopt (req->easy, CURLOPT_FOLLOWLOCATION, 1L);
   curl_easy_setopt (req->easy, CURLOPT_CONNECTTIMEOUT, 30L);
-  curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
-  curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_TIME, 30L);
+  /* We used to set CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME
+   * here, but see https://github.com/ostreedev/ostree/issues/878#issuecomment-347228854
+   * basically those options don't play well with HTTP2 at the moment
+   * where we can have lots of outstanding requests.  Further,
+   * we could implement that functionality at a higher level
+   * more consistently too.
+   */
 
   /* closure bindings -> task */
   curl_easy_setopt (req->easy, CURLOPT_PRIVATE, task);
index 22d3950b58d19f35a5fd37bc4a36df84b60d7c84..93b97eec218d7f119e96915ab735ac0c05d4f5d5 100755 (executable)
@@ -60,7 +60,7 @@ cat > ${test_tmpdir}/ostree-srv/mirrorlist <<EOF
 
 # comment with empty lines around
 
-http://example.com/nonexistent
+$(cat ${test_tmpdir}/content_mirror1-address)/ostree/non-existent-repo
 
 $(cat ${test_tmpdir}/content_mirror1-address)/ostree/gnomerepo
 $(cat ${test_tmpdir}/content_mirror2-address)/ostree/gnomerepo