You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "balaji viswanathan (JIRA)" <ji...@apache.org> on 2017/04/24 12:17:04 UTC

[jira] [Created] (COUCHDB-3394) Keep Alive connections with zero size attachments

balaji viswanathan created COUCHDB-3394:
-------------------------------------------

             Summary: Keep Alive connections with zero size attachments
                 Key: COUCHDB-3394
                 URL: https://issues.apache.org/jira/browse/COUCHDB-3394
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
            Reporter: balaji viswanathan


When a client creates zero bytes attachments using PUT /db/{docid} with multipart/related format (http://docs.couchdb.org/en/2.0.0/api/document/common.html#creating-multiple-attachments) over HTTP/1.1 connection with keep-alive, the server responds with success (200, _id and rev) but the connection is not usable for future requests. 

The next subsequent client request over the same connection times out reading headers from server. 

CouchDB stdout does not print access_log line for the zero byte attachment request.

CouchDB version 2.0.0
Build: 64-bit on ubuntu 16.04 LTS
N=1

Steps to recreate over telnet
------------------------------------
Trying ::1...
Connected to localhost.
Escape character is '^]'.
PUT /testdba HTTP/1.1

HTTP/1.1 201 Created
Cache-Control: must-revalidate
Content-Length: 12
Content-Type: application/json
Date: Mon, 24 Apr 2017 12:04:18 GMT
Location: http://172.17.0.2:5984/testdba
Server: CouchDB/2.0.0 (Erlang OTP/17)
X-Couch-Request-ID: 393a78b1da
X-CouchDB-Body-Time: 0

{"ok":true}
PUT /testdba/zeroattach HTTP/1.1
Host: couchdb:5985
User-Agent: Go-http-client/1.1
Content-Length: 371
Accept: application/json
Content-Type: multipart/related;boundary="52e8ac3f8a8a383cb2924479f814f62b38ff56f5c28a2c064dff8946b00a"
Accept-Encoding: gzip

--52e8ac3f8a8a383cb2924479f814f62b38ff56f5c28a2c064dff8946b00a
Content-Type: application/json

{"_attachments":{"valueBytes":{"follows":true,"content_type":"application/octet-stream","length":0}},"appsncodeid":"ns2","version":"1:4"}
--52e8ac3f8a8a383cb2924479f814f62b38ff56f5c28a2c064dff8946b00a


--52e8ac3f8a8a383cb2924479f814f62b38ff56f5c28a2c064dff8946b00a--
HTTP/1.1 201 Created
Cache-Control: must-revalidate
Content-Length: 73
Content-Type: application/json
Date: Mon, 24 Apr 2017 12:04:56 GMT
ETag: "1-194daebc5ecc1b60624d80283df6b50d"
Location: http://couchdb:5985/testdba/zeroattach
Server: CouchDB/2.0.0 (Erlang OTP/17)
X-Couch-Request-ID: 7ac6fa4636
X-CouchDB-Body-Time: 0

{"ok":true,"id":"zeroattach","rev":"1-194daebc5ecc1b60624d80283df6b50d"}
GET /testdba/zeroattach?attachments=true HTTP/1.1

-- hang --






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)