Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DEEA3ECAA for ; Fri, 14 Dec 2012 00:57:08 +0000 (UTC) Received: (qmail 94848 invoked by uid 500); 14 Dec 2012 00:57:08 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 94673 invoked by uid 500); 14 Dec 2012 00:57:08 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 94665 invoked by uid 99); 14 Dec 2012 00:57:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2012 00:57:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.42] (HELO mail-pb0-f42.google.com) (209.85.160.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2012 00:57:00 +0000 Received: by mail-pb0-f42.google.com with SMTP id rp2so1802233pbb.15 for ; Thu, 13 Dec 2012 16:56:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version:x-mailer :x-gm-message-state; bh=HxEb/ImH/nvnCboUobELTFx7WvhDtMfCbrmWG4kLDvo=; b=MFGtucgwEPGlO5NVNs4zrBWzij1fXzTqIrcEnlF+7n8a50T0lBqpfYK8R233DSS3b8 odCGplkkfGsnzEg7i13EUul9v5n7rrP0Cnc7B8Kjen3HVtUbu986xYqVjXt5/8lvDK3i CSXs82pL9EWUJ1J1oNXvI/OlXu5OSyq+AZfIWTW/RCNaFQHOzCqWHuMbIojqLrtCIpPu Lf4BF/49lSzkDV/1aQuI2YgK/EAtXrwLIYxLNYPmh53ZULwhDSyMjs30hlLndETPyXMa 6S+RW/MKax0ALn7RMxePQA+sEIyoM+3iJ0zTat7EwRAcA/g0nUHrRhuvprg5K66xBzDH QOzg== Received: by 10.66.83.136 with SMTP id q8mr11008756pay.83.1355446599642; Thu, 13 Dec 2012 16:56:39 -0800 (PST) Received: from [10.1.10.18] (c-67-180-35-133.hsd1.ca.comcast.net. [67.180.35.133]) by mx.google.com with ESMTPS id j9sm2144040paw.2.2012.12.13.16.56.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 16:56:38 -0800 (PST) From: Adam Silberstein Content-Type: multipart/alternative; boundary="Apple-Mail=_91863FFF-6007-464C-83CF-14DB85E431CB" Subject: question about server startup time in testing env Message-Id: <2FEE8553-1609-4E60-8A4F-909E6432356E@trifacta.com> Date: Thu, 13 Dec 2012 16:56:35 -0800 To: user@zookeeper.apache.org Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) X-Mailer: Apple Mail (2.1485) X-Gm-Message-State: ALoCoQkqYlyyeUGhWkOjRHZNypsUyEklgo9C7DPixPb7RAAeMutTtUgw12SmfksQrA6ODb7AC8cR X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_91863FFF-6007-464C-83CF-14DB85E431CB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, I've written a test helper class that starts up ZK in-process and tears = it down when done. Here's a code snippet: static NIOServerCnxnFactory _standaloneServerFactory; public static int _clientPort =3D 21818; static ZooKeeperServer _server; =20 _server =3D new ZooKeeperServer(dir, dir, tickTime); _standaloneServerFactory =3D new NIOServerCnxnFactory(); _standaloneServerFactory.configure(new InetSocketAddress(_clientPort), = numConnections); _standaloneServerFactory.startup(_server); One thing I've noticed is that the final line appears to be synchronous = in nature, whenever I attempt to connect to ZK immediately, my client = fails. Currently, I just retry a few times. Is there a programmatic = way to check when the server is read for connections? I tried a few = method calls on ZooKeeperServer but nothing was helpful there. Thanks, Adam=20= --Apple-Mail=_91863FFF-6007-464C-83CF-14DB85E431CB--