From dev-return-54458-archive-asf-public=cust-asf.ponee.io@thrift.apache.org Thu Jan 3 01:30:05 2019 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 8A352180662 for ; Thu, 3 Jan 2019 01:30:04 +0100 (CET) Received: (qmail 44704 invoked by uid 500); 3 Jan 2019 00:30: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 44693 invoked by uid 99); 3 Jan 2019 00:30:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2019 00:30:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2F4A0180CDB for ; Thu, 3 Jan 2019 00:30:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4cJTOSwZ1fqk for ; Thu, 3 Jan 2019 00:30: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 042135FB1C for ; Thu, 3 Jan 2019 00:30: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 52159E0104 for ; Thu, 3 Jan 2019 00:30: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 0C60B253CC for ; Thu, 3 Jan 2019 00:30:00 +0000 (UTC) Date: Thu, 3 Jan 2019 00:30:00 +0000 (UTC) From: "James E. King III (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (THRIFT-4469) isServing is not thread safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-4469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James E. King III updated THRIFT-4469: -------------------------------------- Labels: easyfix (was: ) > isServing is not thread safe > ---------------------------- > > Key: THRIFT-4469 > URL: https://issues.apache.org/jira/browse/THRIFT-4469 > Project: Thrift > Issue Type: Bug > Components: Java - Library > Affects Versions: 0.9.3, 0.10.0, 0.11.0, 0.12.0 > Reporter: Robert Joseph Evans > Priority: Major > Labels: easyfix > Time Spent: 10m > Remaining Estimate: 0h > > We have some integration tests in storm were we create a TServer and call serve on it in a background thread, because it is a blocking call. > Then in the main thread we wait for up to 10 seconds for isServing to return success with a 100ms sleep in between each call. > I don't know if this is a java bug or what, but in some not so rare cases isServing does not return true during the entire 10 seconds and the test fails. The test prints out a stack trace when this happens and the background thread running the server is always at > https://github.com/apache/thrift/blob/b636ffb613ab49e0f037fbe696d28a4b17a72c5f/lib/java/src/org/apache/thrift/server/AbstractNonblockingServer.java#L95 > happily serving. > So either we got very unlucky many times and it takes just a few ms longer than 10 seconds to come up some times, and < 1 sec other times, or java is doing something strange some of the time, and because Server.isServing is not volatile the checking thread caches a copy of it in a register and never updates it during the 10 seconds of the test run. > Even if it is a java bug, which I could argue probably is, it would be good to make isServing volatile. -- This message was sent by Atlassian JIRA (v7.6.3#76005)