OK. I'll let you know what happens with the empirical testing. We have a
second service reporting a problem that sounds like a connection leak, and
I've asked them to deploy this patch as well.

On Tue, Apr 27, 2021 at 11:07 PM Oleg Kalnichevski <[email protected]> wrote:

> Hi Ryan
>
> I think the fix looks valid as an extra safe-guard, though I really do
> not see what should be causing a connection leak in the first place. It
> would really help to have a test case reproducing the issue.
>
> I will apply the patch nonetheless.
>
> Cheers
>
> Oleg
>
> On 4/27/2021 8:39 PM, Ryan Schmitt wrote:
> > I may have spoken too soon; it looks like perhaps there _is_ another
> > connection leak in 5.0.3. Fortunately, the user supplied a patch which he
> > claims fixes it. Oleg, does this patch make sense to you?
> >
> > diff --git
> >
> src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
> >
> src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
> > index a344265..9911f29 100644
> > ---
> >
> src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
> > +++
> >
> src/main/java/org/apache/hc/client5/http/impl/classic/InternalExecRuntime.java
> > @@ -115,6 +115,12 @@ class InternalExecRuntime implements ExecRuntime,
> > Cancellable {
> >                   reusable = connectionEndpoint.isConnected();
> >                   if (cancellableDependency != null) {
> >                       cancellableDependency.setDependency(this);
> > +                    // if the dependency was already cancelled
> > setDependency will trigger cancellation
> > +                    // and in that case we shouldn't acquire
> successfully
> > +                    if (cancellableDependency.isCancelled()) {
> > +                        this.cancel();
> > +                        throw new RequestFailedException("Request
> > aborted");
> > +                    }
> >                   }
> >                   if (log.isDebugEnabled()) {
> >                       log.debug("{} acquired endpoint {}", id,
> > ConnPoolSupport.getId(connectionEndpoint));
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to