From api-return-1084-archive-asf-public=cust-asf.ponee.io@directory.apache.org Mon Mar 22 18:41:40 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id C1B7A180621 for ; Mon, 22 Mar 2021 19:41:40 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 2CFB163B29 for ; Mon, 22 Mar 2021 18:41:40 +0000 (UTC) Received: (qmail 23382 invoked by uid 500); 22 Mar 2021 18:41:39 -0000 Mailing-List: contact api-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list api@directory.apache.org Received: (qmail 23365 invoked by uid 99); 22 Mar 2021 18:41:39 -0000 Received: from spamproc1-he-de.apache.org (HELO spamproc1-he-de.apache.org) (116.203.196.100) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2021 18:41:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-de.apache.org (ASF Mail Server at spamproc1-he-de.apache.org) with ESMTP id 664931FF4A5 for ; Mon, 22 Mar 2021 18:41:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-de.apache.org X-Spam-Flag: NO X-Spam-Score: 3.45 X-Spam-Level: *** X-Spam-Status: No, score=3.45 tagged_above=-999 required=6.31 tests=[ENA_SUBJ_ODD_CASE=3.2, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-de.apache.org [116.203.196.100]) (amavisd-new, port 10024) with ESMTP id Pm9ibCdjcl9B for ; Mon, 22 Mar 2021 18:41:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.210.43; helo=mail-ot1-f43.google.com; envelope-from=shawn.michael.mckinney@gmail.com; receiver= Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id EB93D7FC65 for ; Mon, 22 Mar 2021 18:41:37 +0000 (UTC) Received: by mail-ot1-f43.google.com with SMTP id v24-20020a9d69d80000b02901b9aec33371so16979750oto.2 for ; Mon, 22 Mar 2021 11:41:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=bi6msK0kW+DlM/cMBaZxuJJ3K5l6qBgeZXhZZHfukdA=; b=pGtZa1zP34O+2v2JMVaLk8am0ZxUPmEv0xCnuSBXJOxD+o4wVVu7mIyMYxk6e+WJ78 /v5mu2KmNEP9dq6WMb7xA01myu8ivXy9vkS3gIho+VM6tHzsk/PBV02xZQnfPKhXUn+b NSlic6eUMuuj0GpRJMVhVmfpIQe3dRT6dbeuXyHQ73ZrWuvZC+idGhVvx7aSvNJ7FqFJ dMjZOBfCQM3DwOjWRZT970TKY71A7X0GXQHVLWv6zShqc43fMo06AnlJJh1cZagg/sYg HqOlTa+7n0C+fVquI1zSNdLgecdDbAYoGiIxNvIVojdH1V3//gpPaSJWSsR51mBWD5tF UXmA== X-Gm-Message-State: AOAM530tO4ihSEJDswdqDPySFp5kn1u5Nlc7q2UQtvk6Zliol9adrXDL ojY1M4C/LEWImUObkhaOEjeJVKjdk62u7A== X-Google-Smtp-Source: ABdhPJxNYJswkbBW0YcroIlHM5a0aZU1AbYFHcdvlpzibUTeNYAwJwi78oskUp4vyPFdDOoXficyZw== X-Received: by 2002:a05:6830:1e45:: with SMTP id e5mr1006484otj.40.1616438490824; Mon, 22 Mar 2021 11:41:30 -0700 (PDT) Received: from shawns-mbp-9155.attlocal.net ([2600:1700:eca0:8550:2c1e:a2d4:a9d0:d4a]) by smtp.gmail.com with ESMTPSA id p3sm3260189oif.53.2021.03.22.11.41.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Mar 2021 11:41:30 -0700 (PDT) From: Shawn McKinney Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) Subject: Re: LdapConnectionPool.getConnection doing extraneous search? Date: Mon, 22 Mar 2021 13:41:28 -0500 References: <1CDE07B8-5AAA-48DA-B364-D87F9678179C@apache.org> <6c683582-3f9d-2bb8-21ae-2723f08a3de4@gmail.com> <811583D9-F9A8-4F28-90DF-CCBBDC380861@apache.org> <41EE2818-F802-415D-B740-0D8EE699959C@apache.org> <67ade323-6b58-ac82-d6dc-fd6e37fa8de0@gmail.com> To: api@directory.apache.org In-Reply-To: <67ade323-6b58-ac82-d6dc-fd6e37fa8de0@gmail.com> Message-Id: <7417C637-DFB5-4DE0-8BB8-DD3948466046@apache.org> X-Mailer: Apple Mail (2.3445.9.5) > On Mar 22, 2021, at 11:05 AM, Emmanuel L=C3=A9charny = wrote: >=20 > LDAP connections are quite stable. Again, this check is there to = respect the commons-pool API contract. If the connection is dead, then = doing this check will let the pool fetching another connection, which is = good. OTOH, if you don't want to check connections while fetching one, = then you are on your own (ie, deal with the consequences of a bad = connection). Again, I must disagree. Connections aren=E2=80=99t stable, subjected to = env conditions and we can never assume a connection is good. Something = in the API chain must do the job of testing and reconnect, every time = it=E2=80=99s pulled from the pool. Now, having said that, that=E2=80=99s exactly what I=E2=80=99m observing = currently, with the test on borrow flag turned off. Let me explain the scenario: 1. Start server 2. Start client This initializes a connection pool which creates and stores exactly 1 = connection (min 1, max1 ) 3. Set breakpoint in client on pool.getConnection method 4. Restart the server. 5. Client performs ldap op which triggers the breakpoint on = getConnection 6. Server at this point still hasn=E2=80=99t any connections with the = client. The client =E2=80=98thinks=E2=80=99 it has connections in the = pool, but these were broken on step 4. 7. Step over the getConnection which then triggers the commons pool to = execute: ``` = GenericObjectPool._factory.activateObject(latch.getPair().value) ``` 8. A connection is made with the server, along with bind ``` 6058e163 conn=3D1000 fd=3D14 ACCEPT from IP=3D127.0.0.1:35246 = (IP=3D127.0.0.1:389) [exec] 6058e163 conn=3D1000 op=3D0 BIND = dn=3D"cn=3Dmanager,dc=3Dexample,dc=3Dcom" method=3D128 [exec] 6058e163 conn=3D1000 op=3D0 BIND = dn=3D"cn=3Dmanager,dc=3Dexample,dc=3Dcom" mech=3DSIMPLE ssf=3D0 [exec] 6058e163 conn=3D1000 op=3D0 RESULT tag=3D97 err=3D0 = duration=3D1.667ms ``` 9. Client continues with its ldap op successfully and is never the wiser = that the connections were all forcibly closed on server restart. This is EXACTLY what I want to see all of which is done without the test = on borrow eliminating the extraneous search on every connection = retrieval. =E2=80=94 Shawn --------------------------------------------------------------------- To unsubscribe, e-mail: api-unsubscribe@directory.apache.org For additional commands, e-mail: api-help@directory.apache.org