Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A100200B65 for ; Wed, 17 Aug 2016 21:58:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 48B7C160AB5; Wed, 17 Aug 2016 19:58:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7933A160A8C for ; Wed, 17 Aug 2016 21:58:21 +0200 (CEST) Received: (qmail 95717 invoked by uid 500); 17 Aug 2016 19:58:20 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 95601 invoked by uid 99); 17 Aug 2016 19:58:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2016 19:58:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7F4992C02A5 for ; Wed, 17 Aug 2016 19:58:20 +0000 (UTC) Date: Wed, 17 Aug 2016 19:58:20 +0000 (UTC) From: "Josh Elser (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-4412) Race condition in starting proxy for ITs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 17 Aug 2016 19:58:22 -0000 [ https://issues.apache.org/jira/browse/ACCUMULO-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15425244#comment-15425244 ] Josh Elser commented on ACCUMULO-4412: -------------------------------------- I have a test-only fix for this. Was able to verify that it works doing a little trick: {code} proxyPort = PortUtils.getRandomFreePort(); if (0 == r.nextInt(2)) { final ServerSocket so = new ServerSocket(proxyPort); svc.schedule(new Callable() { public Void call() throws Exception { log.info("Closing socket"); so.close(); return null; } }, 5, TimeUnit.SECONDS); } {code} > Race condition in starting proxy for ITs > ---------------------------------------- > > Key: ACCUMULO-4412 > URL: https://issues.apache.org/jira/browse/ACCUMULO-4412 > Project: Accumulo > Issue Type: Bug > Components: proxy, test > Reporter: Josh Elser > Assignee: Josh Elser > Priority: Minor > Fix For: 1.7.3, 1.8.1 > > > Had a test failure last night in KerberosProxyIT. It seems the following happened > # Bind a server socket using '0' (pull a free port from the ephemeral range) > # Determine the actual port which was bound > # Close the socket > # Another process grabbed the port we had bound > # Attempt to start the proxy on that port > The proxy failed to start because the port we provided was already taken. This stems from a problem that we can't have the Proxy bind to any free port and figure out where it started (what port it actually bound); maybe we could provide configuration to advertise this in ZooKeeper (will file another issue). For this test, if we fail to connect to the proxy and the proxy is dead, we can try to re-start the proxy with a different port. Given how rare this scenario is, hopefully retrying it takes the chance it happens again to effectively 0%. -- This message was sent by Atlassian JIRA (v6.3.4#6332)