You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/05/26 03:37:25 UTC

[couchdb] branch handle-shutdown-emitted-from-chttpd created (now 5c1e17dea)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch handle-shutdown-emitted-from-chttpd
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 5c1e17dea Handle exit(shutdown) error in chttpd

This branch includes the following new commits:

     new 5c1e17dea Handle exit(shutdown) error in chttpd

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Handle exit(shutdown) error in chttpd

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch handle-shutdown-emitted-from-chttpd
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 5c1e17deaede4715e6b49a507530d617867837da
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Wed May 25 23:23:49 2022 -0400

    Handle exit(shutdown) error in chttpd
    
    We handle mochiweb's `{shutdown, Error}` exit. However, chttpd itself exits
    with a plain `exit(shutdown)`, and in that case, our nested catch statements
    [1] will emit an "unknown_error" log line. So, make sure to handle that as well
    in order to keep the log noise down.
    
    [1] `handle_req_after_auth/2` is nested inside `process_request/1`
    https://github.com/apache/couchdb/blob/3.x/src/chttpd/src/chttpd.erl#L386 and
    both call `catch_error/4`
---
 src/chttpd/src/chttpd.erl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 4f6ec06c7..48280e80c 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -1140,6 +1140,8 @@ maybe_handle_error(Error) ->
             {500, couch_util:to_binary(Err), couch_util:to_binary(Reason)};
         normal ->
             exit(normal);
+        shutdown ->
+            exit(shutdown);
         Err ->
             {500, <<"unknown_error">>, couch_util:to_binary(Err)}
     end.