From dev-return-53004-archive-asf-public=cust-asf.ponee.io@thrift.apache.org Thu Jul 5 13:14:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B2CE0180657 for ; Thu, 5 Jul 2018 13:14:04 +0200 (CEST) Received: (qmail 68860 invoked by uid 500); 5 Jul 2018 11:14:03 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 68849 invoked by uid 99); 5 Jul 2018 11:14:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2018 11:14:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C11C21A1F15 for ; Thu, 5 Jul 2018 11:14:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 94r-c2pOuXsZ for ; Thu, 5 Jul 2018 11:14:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 255145F5B1 for ; Thu, 5 Jul 2018 11:14:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 60D41E00FF for ; Thu, 5 Jul 2018 11:14:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 206EB274FA for ; Thu, 5 Jul 2018 11:14:00 +0000 (UTC) Date: Thu, 5 Jul 2018 11:14:00 +0000 (UTC) From: "James E. King III (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (THRIFT-4598) TBinaryProtocol.readMessageBegin() hangs forever in Java MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-4598?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] James E. King III resolved THRIFT-4598. --------------------------------------- Resolution: Duplicate > TBinaryProtocol.readMessageBegin() hangs forever in Java > -------------------------------------------------------- > > Key: THRIFT-4598 > URL: https://issues.apache.org/jira/browse/THRIFT-4598 > Project: Thrift > Issue Type: Bug > Components: Java - Library > Affects Versions: 0.11.0 > Environment: Ubuntu Linux 16.04 x86_64 > Reporter: Mario Emmenlauer > Assignee: James E. King III > Priority: Major > > I run some internal tests for the robustness of our thrift Java server. O= ne of the robustness tests is to try to connect to the secure server socket= with an insecure client and vice versa. This may seem a slightly diabolic = test but it can be a=C2=A0simple user error to forget enabling or disabling= encryption. So I think thrift should handle this gracefully. > However it seems that this test leads to an infinitely hanging server thr= ead! The thread blocks the jvm (Java 1.8.0_161 x86_64) from ending. I can s= ee in jstack that the main method ends and=C2=A0there are almost no threads= left, except some garbage collectors and finalizers plus org.apache.thrift= .server.TThreadPoolServer. > Here is the call stack of the thrift server thread: > {code:java} > java.lang.Thread.State: RUNNABLE > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) > at java.net.SocketInputStream.read(SocketInputStream.java:171) > at java.net.SocketInputStream.read(SocketInputStream.java:141) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) > at java.io.BufferedInputStream.read1(BufferedInputStream.java:286) > at java.io.BufferedInputStream.read(BufferedInputStream.java:345) > - locked <0x000000067b390fd8> (a java.io.BufferedInputStream) > at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport= .java:127) > at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86) > at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.jav= a:425) > at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.jav= a:321) > at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryPro= tocol.java:225) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:27) > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPo= olServer.java:310) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j= ava:1149) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.= java:624) > at java.lang.Thread.run(Thread.java:748) > {code} > I already=C2=A0reduced=C2=A0the server socket timeout to 30sec and the re= questTimeout to 10sec. Is there anything else I can do to=C2=A0timeout=C2= =A0readMessageBegin()? -- This message was sent by Atlassian JIRA (v7.6.3#76005)