Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5801E588 for ; Wed, 13 Mar 2013 16:48:13 +0000 (UTC) Received: (qmail 22372 invoked by uid 500); 13 Mar 2013 16:48:13 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 22333 invoked by uid 500); 13 Mar 2013 16:48:13 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 22324 invoked by uid 99); 13 Mar 2013 16:48:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Mar 2013 16:48:13 +0000 Date: Wed, 13 Mar 2013 16:48:12 +0000 (UTC) From: "Adam Lofts (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (COUCHDB-1702) Recv failure: Connection reset by peer in form_submit.js test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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