couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Lofts (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COUCHDB-1702) Recv failure: Connection reset by peer in form_submit.js test
Date Wed, 13 Mar 2013 16:48:12 GMT
Adam Lofts created COUCHDB-1702:
-----------------------------------

             Summary: Recv failure: Connection reset by peer in form_submit.js test
                 Key: COUCHDB-1702
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1702
             Project: CouchDB
          Issue Type: Bug
            Reporter: Adam Lofts


On Ubuntu 12.10 the form_submit test case sometimes fails with:

{code}
not ok 1 form_submit
Reason: Failed to execute HTTP request: Recv failure: Connection reset by peer
Trace back (most recent call first):
    
  37: /home/adam/dev/fp3/couchdb/test/javascript/couch_http.js
      ("{}")
 425: /home/adam/dev/fp3/couchdb/share/www/script/couch.js
      ("POST","/test_suite_db/baz",[object Object])
  20: /home/adam/dev/fp3/couchdb/share/www/script/test/form_submit.js
      ()
  53: /home/adam/dev/fp3/couchdb/test/javascript/cli_runner.js
      runTestConsole(1,"form_submit",(function (debug) {var db = new CouchDB
  72: /home/adam/dev/fp3/couchdb/test/javascript/cli_runner.js
      runAllTestsConsole()
  85: /home/adam/dev/fp3/couchdb/test/javascript/cli_runner.js
{code}

By debugging the send() calls I see that couchdb is closing the socket before the response
body gets sent. I.e. The data is getting discarded in the kernel buffer.

There are a variety of references for this issue:

http://stackoverflow.com/questions/8874021/close-socket-directly-after-send-unsafe

http://ia600609.us.archive.org/22/items/TheUltimateSo_lingerPageOrWhyIsMyTcpNotReliable/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable.html

In my testing I have found that adding a shutdown() call before close() fixes this issue for
me. 

A branch with the shutdown() call is available here: 
https://github.com/adamlofts/couchdb/tree/form-submit-test-failure



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message