You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Mark Hammond (JIRA)" <ji...@apache.org> on 2009/08/05 03:32:14 UTC
[jira] Created: (COUCHDB-452) couch logs an [error] record if a
client disconnects
couch logs an [error] record if a client disconnects
----------------------------------------------------
Key: COUCHDB-452
URL: https://issues.apache.org/jira/browse/COUCHDB-452
Project: CouchDB
Issue Type: Improvement
Reporter: Mark Hammond
If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
[error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
[info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
{couch_httpd,send_chunk,2},
{couch_httpd_view,send_json_view_row,5},
{couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
{couch_view,fold_fun,4},
{couch_btree,stream_kv_node2,7},
{couch_btree,stream_kp_node,7},
{couch_btree,fold,5}]
This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
FYI, the easiest way I found to repro this was to execute:
% python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Curt Arnold (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739543#action_12739543 ]
Curt Arnold commented on COUCHDB-452:
-------------------------------------
Raised this issue on the mochiweb project site: http://code.google.com/p/mochiweb/issues/detail?id=39 in addition to the COUCHDB-394.
Mochiweb discards the value returned from gen_tcp:send, so there is not any way to distinguish a premature close from some more significant problem.
I definitely spent some time trying to figure out why I was getting 500 return codes in the logs on what appeared to be normal activities.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Hammond resolved COUCHDB-452.
----------------------------------
Resolution: Invalid
Out of date - the trunk now completely ignores that case without even logging an info record.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740117#action_12740117 ]
Chris Anderson commented on COUCHDB-452:
----------------------------------------
The special case matches were added one at a time, because those are two special cases where having a stacktrace in the logs can help with debugging on the ML and IRC.
However, the general matcher now logs a stacktrace just the same as they did, so it's fine to let the general case handle them. (I guess we finally got few enough errors coming from deep within CouchDB that a stacktrace on any uncaught error works fine.)
Removing the special case matchers just cleans up the code and does not change functionality.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739463#action_12739463 ]
Jan Lehnardt commented on COUCHDB-452:
--------------------------------------
It will match, but why don't we want to keep the special case. maybe the question boils down to why did we have them in the first place. Just wondering about the change.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739516#action_12739516 ]
Adam Kocoloski commented on COUCHDB-452:
----------------------------------------
Thanks for fixing the {exit,normal} stuff, Mark. I don't have an opinion about whether to remove the explicit checks for badarg and function_clause errors.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Curt Arnold (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739539#action_12739539 ]
Curt Arnold commented on COUCHDB-452:
-------------------------------------
Seems to be a duplicate (or at least similar) to COUCHDB-394.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740087#action_12740087 ]
Adam Kocoloski commented on COUCHDB-452:
----------------------------------------
Yes, that's a good point Curt. Just yesterday Jason needed to add some logging in MochiWeb to find out that a gen_tcp:recv was timing out. The log just said {exit,normal} there, too.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739443#action_12739443 ]
Mark Hammond commented on COUCHDB-452:
--------------------------------------
> Why do we get rid of the badarg & function_clause cases?
jchris implies, but I didn't confirm, the Tag:Error handler will still match these.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739405#action_12739405 ]
Jan Lehnardt commented on COUCHDB-452:
--------------------------------------
Why do we get rid of the badarg & function_clause cases?
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-452) couch logs an [error] record if a
client disconnects
Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Hammond updated COUCHDB-452:
---------------------------------
Attachment: dont_log_error_on_disconnect.patch
Patch which causes a simple:
[info] [<0.66.0>] remote connection dropped prematurely
record to be written. jchris also suggested I remove the error:badarg and error:function_clause handlers as these are picked up by the Tag:Error handler - so they have gone too.
> couch logs an [error] record if a client disconnects
> ----------------------------------------------------
>
> Key: COUCHDB-452
> URL: https://issues.apache.org/jira/browse/COUCHDB-452
> Project: CouchDB
> Issue Type: Improvement
> Reporter: Mark Hammond
> Attachments: dont_log_error_on_disconnect.patch
>
>
> If a client makes a request which returns multiple rows (eg, a query) but disconnects before reading the response, couch logs:
> [error] [<0.66.0>] Uncaught error in HTTP request: {exit,normal}
> [info] [<0.66.0>] Stacktrace: [{mochiweb_request,send,2},
> {couch_httpd,send_chunk,2},
> {couch_httpd_view,send_json_view_row,5},
> {couch_httpd_view,'-make_view_fold_fun/6-fun-0-',12},
> {couch_view,fold_fun,4},
> {couch_btree,stream_kv_node2,7},
> {couch_btree,stream_kp_node,7},
> {couch_btree,fold,5}]
> This could lead someone to conclude couch has an error which is not correct. A simple [info] record recording the premature normal exit is probably more appropriate.
> FYI, the easiest way I found to repro this was to execute:
> % python -c "import urllib; urllib.urlopen('http://127.0.0.1:5984/your_db/_design/your_design_doc/_view/your_view?reduce=false').close()"
> which causes Python to open a connection and close it without reading anything. I'll attach a patch as suggested generally by jchris.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.