Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
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
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
GET /testdba/zeroattach?attachments=true HTTP/1.1
– hang –