You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2019/05/12 11:08:12 UTC

[thrift] branch master updated: Report error for abnormal server termination only Client: erl

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

jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new ce32ed7  Report error for abnormal server termination only Client: erl
ce32ed7 is described below

commit ce32ed70124f4213894f2c0cfdb76bf624ce62b6
Author: Sergey Elin <el...@gmail.com>
AuthorDate: Sun May 5 20:14:43 2019 +0300

    Report error for abnormal server termination only
    Client: erl
---
 lib/erl/src/thrift_socket_server.erl | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/erl/src/thrift_socket_server.erl b/lib/erl/src/thrift_socket_server.erl
index 4e3c052..432e65b 100644
--- a/lib/erl/src/thrift_socket_server.erl
+++ b/lib/erl/src/thrift_socket_server.erl
@@ -278,9 +278,13 @@ handle_cast(stop, State) ->
 
 terminate(Reason, #thrift_socket_server{listen=Listen, port=Port}) ->
     gen_tcp:close(Listen),
-    {backtrace, Bt} = erlang:process_info(self(), backtrace),
-    error_logger:error_report({?MODULE, ?LINE,
-                               {child_error, Reason, Bt}}),
+    case Reason of
+        normal -> ok;
+        shutdown -> ok;
+        _ -> {backtrace, Bt} = erlang:process_info(self(), backtrace),
+             error_logger:error_report({?MODULE, ?LINE,
+                                       {child_error, Reason, Bt}})
+    end,
     case Port < 1024 of
         true ->
             catch fdsrv:stop(),