Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-3158

Fix a crash when connection closes for _update

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      There is a crash when the client issue an update request and closes the connection.
      /<dbname>/_design/<desing_docid>/_update/<updater_id>/<doc_id>

      The resulting crash dump is:

      req_err(3443101085) unknown_error : normal
          [<<"mochiweb_request:recv/3 L180">>,  
          <<"mochiweb_request:stream_unchunked_body/4 L540">>,
          <<"mochiweb_request:recv_body/2 L214">>,
          <<"chttpd_external:-json_req_obj/4-lc$^0/1-0-/4 L67">>,
          <<"chttpd_external:-json_req_obj/4-lc$^0/1-0-/4 L67">>,
          <<"chttpd_external:json_req_obj/4 L67">>,
          <<"chttpd_show:send_doc_update_response/6 L119">>, 
          <<"chttpd:process_request/1 L293">>]
      
      1. acra
        1.0 kB
        ILYA

        Issue Links

          Activity

          Hide
          iilyak ILYA added a comment - - edited

          Attaching a script to reproduce the problem

          Show
          iilyak ILYA added a comment - - edited Attaching a script to reproduce the problem
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user iilyak opened a pull request:

          https://github.com/apache/couchdb-chttpd/pull/140

          Handle disconnect when receiving body

          When any error happen on an underlying socket mochiweb uses
          exit(normal). Add catch for exit:normal and convert it to
          exit(

          {bad_request, <<"Incomplete">>}).

          COUCHDB-3158

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cloudant/couchdb-chttpd 69425-handle-truncated-req-in-recv_body

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/couchdb-chttpd/pull/140.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #140

          ----
          commit bce8bf0e91948260465af6a78ae93487f57b39f3
          Author: ILYA Khlopotov <iilyak@apache.org>
          Date: 2016-09-22T23:19:39Z

          Handle disconnect when receiving body

          When any error happen on an underlying socket mochiweb uses
          exit(normal). Add catch for exit:normal and convert it to
          exit({bad_request, <<"Incomplete">>}

          ).

          COUCHDB-3158


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user iilyak opened a pull request: https://github.com/apache/couchdb-chttpd/pull/140 Handle disconnect when receiving body When any error happen on an underlying socket mochiweb uses exit(normal). Add catch for exit:normal and convert it to exit( {bad_request, <<"Incomplete">>}). COUCHDB-3158 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-chttpd 69425-handle-truncated-req-in-recv_body Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-chttpd/pull/140.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #140 ---- commit bce8bf0e91948260465af6a78ae93487f57b39f3 Author: ILYA Khlopotov <iilyak@apache.org> Date: 2016-09-22T23:19:39Z Handle disconnect when receiving body When any error happen on an underlying socket mochiweb uses exit(normal). Add catch for exit:normal and convert it to exit({bad_request, <<"Incomplete">>} ). COUCHDB-3158
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user iilyak opened a pull request:

          https://github.com/apache/couchdb-couch/pull/200

          Adding test suite for trancated _update

          Test suite for https://github.com/apache/couchdb-chttpd/pull/140

          COUCHDB-3158

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cloudant/couchdb-couch 69425-handle-truncated-req-in-recv_body

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/couchdb-couch/pull/200.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #200


          commit 21c374f1dc049d35089092fc513d226f6580a3a6
          Author: ILYA Khlopotov <iilyak@apache.org>
          Date: 2016-09-22T23:11:02Z

          Adding test suite for trancated _update

          COUCHDB-3158


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user iilyak opened a pull request: https://github.com/apache/couchdb-couch/pull/200 Adding test suite for trancated _update Test suite for https://github.com/apache/couchdb-chttpd/pull/140 COUCHDB-3158 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-couch 69425-handle-truncated-req-in-recv_body Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-couch/pull/200.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #200 commit 21c374f1dc049d35089092fc513d226f6580a3a6 Author: ILYA Khlopotov <iilyak@apache.org> Date: 2016-09-22T23:11:02Z Adding test suite for trancated _update COUCHDB-3158
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 3868099565dbf8eb7851c50a2e2940f078aea14e in couchdb-chttpd's branch refs/heads/master from ILYA Khlopotov
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=3868099 ]

          Handle disconnect when receiving body

          When any error happen on an underlying socket mochiweb uses
          exit(normal). Add catch for exit:normal and convert it to
          exit(

          {bad_request, <<"Incomplete">>}

          ).

          COUCHDB-3158

          Show
          jira-bot ASF subversion and git services added a comment - Commit 3868099565dbf8eb7851c50a2e2940f078aea14e in couchdb-chttpd's branch refs/heads/master from ILYA Khlopotov [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=3868099 ] Handle disconnect when receiving body When any error happen on an underlying socket mochiweb uses exit(normal). Add catch for exit:normal and convert it to exit( {bad_request, <<"Incomplete">>} ). COUCHDB-3158
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/couchdb-chttpd/pull/140

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-chttpd/pull/140
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 570376b47cf661804891597329b4b662fafb6a74 in couchdb-couch's branch refs/heads/master from ILYA Khlopotov
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=570376b ]

          Adding test suite for trancated _update

          COUCHDB-3158

          Show
          jira-bot ASF subversion and git services added a comment - Commit 570376b47cf661804891597329b4b662fafb6a74 in couchdb-couch's branch refs/heads/master from ILYA Khlopotov [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=570376b ] Adding test suite for trancated _update COUCHDB-3158
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/couchdb-couch/pull/200

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-couch/pull/200

            People

            • Assignee:
              Unassigned
              Reporter:
              iilyak ILYA
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development