[
https://issues.apache.org/jira/browse/COUCHDB-2834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14941367#comment-14941367
]
Nick Vatamaniuc commented on COUCHDB-2834:
------------------------------------------
Some experiments with curl.
Command below creates a database "db", PUTs two attachments to x/a and y/a.
Connection is reused across 3 requests in same curl command. Wireshark also
confirms. Script below runs in 2 TCP sessions. First is the delete command and
rest is a single session ( - some strange packet length sizes and duplicate ack
warnings).
{code}
DB='http://127.0.0.1:15984/db'
CTYPE="Content-Type: application/octet-stream"
curl -u testuser:testpass -X DELETE $DB
curl -v -u testuser:testpass -X PUT $DB --next \
-v -u testuser:testpass -H "Expect:" -H "$CTYPE" -X PUT --data-binary @2m
"$DB/x/a" --next \
-v -u testuser:testpass -H "Expect:" -H "$CTYPE" -X PUT --data-binary @2m
"$DB/y/a"
{"ok":true}
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 15984 (#0)
* Server auth using Basic with user 'testuser'
> PUT /db HTTP/1.1
> Host: 127.0.0.1:15984
> Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 201 Created
< Cache-Control: must-revalidate
< Content-Length: 12
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 02 Oct 2015 16:41:10 GMT
< Location: http://127.0.0.1:15984/db
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: 6bad671c4b
< X-CouchDB-Body-Time: 0
<
{"ok":true}
* Connection #0 to host 127.0.0.1 left intact
* Found bundle for host 127.0.0.1: 0x7fd53240c7a0
* Re-using existing connection! (#0) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 15984 (#0)
* Server auth using Basic with user 'testuser'
> PUT /db/x/a HTTP/1.1
> Host: 127.0.0.1:15984
> Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/octet-stream
> Content-Length: 2000000
>
* We are completely uploaded and fine
< HTTP/1.1 201 Created
< Cache-Control: must-revalidate
< Content-Length: 64
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 02 Oct 2015 16:41:11 GMT
< Location: http://127.0.0.1:15984/db/x/a
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: b88b70b811
< X-CouchDB-Body-Time: 0
<
{"ok":true,"id":"x","rev":"1-7219667ca52a862e8d0d21498e68f7d3"}
* Connection #0 to host 127.0.0.1 left intact
* Found bundle for host 127.0.0.1: 0x7fd53240c7a0
* Re-using existing connection! (#0) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 15984 (#0)
* Server auth using Basic with user 'testuser'
> PUT /db/y/a HTTP/1.1
> Host: 127.0.0.1:15984
> Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/octet-stream
> Content-Length: 2000000
>
* We are completely uploaded and fine
< HTTP/1.1 201 Created
< Cache-Control: must-revalidate
< Content-Length: 64
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 02 Oct 2015 16:41:11 GMT
< Location: http://127.0.0.1:15984/db/y/a
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: 75a614dca9
< X-CouchDB-Body-Time: 0
<
{"ok":true,"id":"y","rev":"1-7219667ca52a862e8d0d21498e68f7d3"}
* Connection #0 to host 127.0.0.1 left intact
{code}
> Server sends connection: close too early
> ----------------------------------------
>
> Key: COUCHDB-2834
> URL: https://issues.apache.org/jira/browse/COUCHDB-2834
> Project: CouchDB
> Issue Type: Bug
> Security Level: public(Regular issues)
> Reporter: Nick Vatamaniuc
>
> This is related COUCHDB-2833.
> This was found investigating the failure of replication tests. Specifically
> couch_replicator_large_atts_tests, the {local, remote} sub-case.
> The test sets up push replications from local to remote.
> Replication workers have more than 1 document larger than
> MAX_BULK_ATT_SIZE=64K. They start pushing them to the target, using a
> keep-alive connection (default for HTTP 1.1), the first few pipelined
> requests will go through using the same connection, then server will accept
> the first PUT to …/docid?edits=false, then return Connection:close and close
> the connection after the 201 Created result.
> Server should not close request too early and instead keep it open longer.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)