couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Lazzarino" <flazzar...@gmail.com>
Subject odd behavior when PUTting text as attachment with spaces
Date Wed, 31 Dec 2008 21:57:35 GMT
Summary: couchdb is not responsive when PUTting certain text as a
standalone attachment to a doc. I tried to keep the example simple but
I'm not sure on the exact cause. Attached are the example files.

I'm running a checkout from yesterday's HEAD,
CouchDB/0.9.0a730298-incubating (Erlang OTP/R12B) / OS X

curl is used here but I have reproduced it in Ruby's Net:HTTP.

# given a document
% curl -i 'http://127.0.0.1:5984/test_suite_db/bin_doc'
HTTP/1.1 200 OK
Server: CouchDB/0.9.0a730298-incubating (Erlang OTP/R12B)
Etag: "349104662"
Date: Wed, 31 Dec 2008 21:36:17 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 183
Cache-Control: must-revalidate

{"_id":"bin_doc","_rev":"349104662","_attachments":{"picard":{"stub":true,"content_type":"image/jpeg","length":25170},"foo.txt":{"stub":true,"content_type":"text/plain","length":29}}}

# i PUT a text file as an attachment, and it takes less than one second
% md5 pass && cat pass
MD5 (pass) = a76999788386641a3ec798554f1fe7e6
foo
bar

%date; curl -i -X PUT -H 'Content-Type: text/plain' --data-binary
@pass 'http://127.0.0.1:5984/test_suite_db/bin_doc/pass?rev=349104662';
date
Wed Dec 31 16:45:10 EST 2008
HTTP/1.1 201 Created
Server: CouchDB/0.9.0a730298-incubating (Erlang OTP/R12B)
Date: Wed, 31 Dec 2008 21:45:10 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 45
Cache-Control: must-revalidate

{"ok":true,"id":"bin_doc","rev":"3072536905"}Wed Dec 31 16:45:10 EST 2008

# couchdb log, looks good
[info] [<0.17247.0>] 127.0.0.1 - - 'PUT'
/test_suite_db/bin_doc/pass?rev=349104662 201

# i PUT another text file with some leading spaces and it times out
with no log entries on the server side, and it times out after 30
seconds
% md5 fail && cat fail
MD5 (fail) = ca246e73f014a56d1cf0a45804fe8587
 foo
  bar

% date; curl -i -X PUT -H 'Content-Type: text/plain' --data-binary
@fail 'http://127.0.0.1:5984/test_suite_db/bin_doc/fail?rev=3072536905';
date
Wed Dec 31 16:47:51 EST 2008
curl: (52) Empty reply from server
Wed Dec 31 16:48:21 EST 2008

--
franco (flazz)

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message