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 3AA9E10082 for ; Tue, 14 Jan 2014 15:15:36 +0000 (UTC) Received: (qmail 9471 invoked by uid 500); 14 Jan 2014 15:15:35 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 9367 invoked by uid 500); 14 Jan 2014 15:15:34 -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 9358 invoked by uid 99); 14 Jan 2014 15:15:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 15:15:34 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [207.46.163.25] (HELO co9outboundpool.messaging.microsoft.com) (207.46.163.25) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 15:15:26 +0000 Received: from mail10-co9-R.bigfish.com (10.236.132.254) by CO9EHSOBE005.bigfish.com (10.236.130.68) with Microsoft SMTP Server id 14.1.225.22; Tue, 14 Jan 2014 15:15:04 +0000 Received: from mail10-co9 (localhost [127.0.0.1]) by mail10-co9-R.bigfish.com (Postfix) with ESMTP id 1C9CCE02CC for ; Tue, 14 Jan 2014 15:15:04 +0000 (UTC) X-Forefront-Antispam-Report: CIP:213.86.77.6;KIP:(null);UIP:(null);IPV:NLI;H:emea-tc2-edge02.sungard.com;RD:none;EFVD:NLI X-SpamScore: 2 X-BigFish: VPS2(z10d0kzd772h4015Izz1f42h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21a7h1fc6hzzz2dh109h2a8h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dh1fe8h1ff5h2216h22d0h2336h2438h2461h1155h) Received: from mail10-co9 (localhost.localdomain [127.0.0.1]) by mail10-co9 (MessageSwitch) id 1389712502897804_16956; Tue, 14 Jan 2014 15:15:02 +0000 (UTC) Received: from CO9EHSMHS022.bigfish.com (unknown [10.236.132.244]) by mail10-co9.bigfish.com (Postfix) with ESMTP id D668820047 for ; Tue, 14 Jan 2014 15:15:02 +0000 (UTC) Received: from emea-tc2-edge02.sungard.com (213.86.77.6) by CO9EHSMHS022.bigfish.com (10.236.130.32) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 14 Jan 2014 15:15:02 +0000 Received: from EMEA-TC2-CAS02.internal.sungard.corp (10.254.236.3) by emea-tc2-edge02.sungard.com (213.86.77.6) with Microsoft SMTP Server (TLS) id 14.3.169.1; Tue, 14 Jan 2014 15:14:37 +0000 Received: from EMEA-TC2-MB02.internal.sungard.corp ([169.254.2.61]) by emea-tc2-cas02.internal.sungard.corp ([10.254.236.3]) with mapi id 14.03.0169.001; Tue, 14 Jan 2014 15:14:47 +0000 From: To: Subject: Is there an easy way to expire a session for testing? Thread-Topic: Is there an easy way to expire a session for testing? Thread-Index: Ac8ROexKrS8jgeMqRza0yeY59e9n6w== Date: Tue, 14 Jan 2014 15:14:47 +0000 Message-ID: <7B36F63619C46A49B86E0D5AB8CDD20061743867@emea-tc2-mb02.internal.sungard.corp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.236.238] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sungard.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-Virus-Checked: Checked by ClamAV on apache.org Hi=20 Apologies for delibaratly reusing an FAQ item as the title of the question,= but it's when I'm trying to implement the suggestion that I'm having issue= s! I'm currently using the latest C# client, but the code looks identical i= n the Java client, so it may be applicable to both.=20 I'm trying to reconnect to an existing session using the session id and pas= sword in order to force an expiry in a unit test. The connection works ok, = but actually forcing the expiry seems very flaky. The problem seems to occu= r at the line: SubmitRequest(new RequestHeader { Type =3D (int)OpC= ode.CloseSession }, null, null, null); Or=20 RequestHeader h =3D new RequestHeader(); h.setType(ZooDefs.OpCode.closeSession); submitRequest(h, null, null, null); in the Java case. In many cases the client is in the state CONNECTION_LOST = (which seems ok, as it normally reconnects?), so the send fails, but as the= client is in the process of shutting down, it's not resent, and so the ser= ver never gets the explicit expiry, which means the original connection nev= er gets a SessionExpired error. Is there a unit test anywhere in the codeba= se that shows how to implement tests like this reliably? I've even tried pe= rforming the session expiry in a separate process, but this doesn't appear = to work reliably either Thanks, Ben