[ 
https://issues.apache.org/jira/browse/COUCHDB-2834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14941414#comment-14941414
 ] 

Nick Vatamaniuc commented on COUCHDB-2834:
------------------------------------------

Another experiment. Setting an invalid Content-Length on the request make 
server block for at least 10+ seconds. Then returns with a 500 Error 
{"error":"unknown_error","reason":"undefined"} and connect is closed.

{code}
#!/bin/sh
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 
-H "Content-Length: 9999999" "$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 17:04:04 GMT
< Location: http://127.0.0.1:15984/db
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: 0824cbfdef
< 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: 0x7fb3cc901730
* 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: 9999999
>
* We are completely uploaded and fine
< HTTP/1.1 500 Internal Server Error
< Cache-Control: must-revalidate
< Connection: close
< Content-Length: 47
< Content-Type: text/plain; charset=utf-8
< Date: Fri, 02 Oct 2015 17:05:04 GMT
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: 7409bb037f
< X-CouchDB-Body-Time: 0
<
{"error":"unknown_error","reason":"undefined"}
* Closing connection 0
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 15984 (#1)
* 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 17:05:04 GMT
< Location: http://127.0.0.1:15984/db/y/a
< Server: CouchDB/4ca9e41 (Erlang OTP/17)
< X-Couch-Request-ID: 16743bb3a4
< X-CouchDB-Body-Time: 0
<
{"ok":true,"id":"y","rev":"1-7219667ca52a862e8d0d21498e68f7d3"}
* Connection #1 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)

Reply via email to