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 2018/05/01 12:16:45 UTC

[thrift] branch master updated: THRIFT-3769 : Fix logic of THRIFT-2268

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 33fb1a3  THRIFT-3769 : Fix logic of THRIFT-2268
33fb1a3 is described below

commit 33fb1a3f0da71ba79e3156f7d0c169e7480fcf26
Author: Vihang Karajgaonkar <vi...@cloudera.com>
AuthorDate: Fri Apr 13 11:32:20 2018 -0700

    THRIFT-3769 : Fix logic of THRIFT-2268
    
    Client: java
---
 .../org/apache/thrift/server/TThreadPoolServer.java  | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java b/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
index 53c20e9..3b5f21e 100644
--- a/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
+++ b/lib/java/src/org/apache/thrift/server/TThreadPoolServer.java
@@ -311,14 +311,24 @@ public class TThreadPoolServer extends TServer {
               break;
             }
         }
-      } catch (TSaslTransportException ttx) {
-        // Something thats not SASL was in the stream, continue silently
-      } catch (TTransportException ttx) {
-        // Assume the client died and continue silently
       } catch (TException tx) {
         LOGGER.error("Thrift error occurred during processing of message.", tx);
       } catch (Exception x) {
-        LOGGER.error("Error occurred during processing of message.", x);
+        // We'll usually receive RuntimeException types here
+        // Need to unwrap to ascertain real causing exception before we choose to ignore
+        Throwable realCause = x.getCause();
+        // Ignore err-logging all transport-level/type exceptions
+        if ((realCause != null && realCause instanceof TTransportException)
+            || (x instanceof TTransportException)) {
+          if (LOGGER.isDebugEnabled()) {
+            // Write to debug, just in case the exception gets required
+            LOGGER
+                .debug("Received TTransportException during processing of message, ignoring: ", x);
+          }
+        } else {
+          // Log the exception at error level and continue
+          LOGGER.error("Error occurred during processing of message.", x);
+        }
       } finally {
         if (eventHandler != null) {
           eventHandler.deleteContext(connectionContext, inputProtocol, outputProtocol);

-- 
To stop receiving notification emails like this one, please contact
jking@apache.org.