pg.ddx.io  aws/aws-advanced-jdbc-wrapper GitHub issues and pull requests  
help / color / mirror / Atom feed
From: aaron-congo (@aaron-congo) <noreply+aaron-congo@github.com>
To: aws/aws-advanced-jdbc-wrapper <noreply+aws-aws-advanced-jdbc-wrapper@github.com>
Subject: Re: [aws/aws-advanced-jdbc-wrapper] PR #2237: feat: add efm3 host monitoring plugin with per-connection registration
Date: Wed, 18 Nov 2026 22:21:35 +0000
Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621666403@github.com> (raw)
In-Reply-To: <gh-aws-aws-advanced-jdbc-wrapper-2237@github.com>
References: <gh-aws-aws-advanced-jdbc-wrapper-2237@github.com>

(on wrapper/src/main/java/software/amazon/jdbc/plugin/efm/v3/HostMonitorServiceV3Impl.java)

nit: the monitor initializer lambda reads instance fields, so it captures `this`, and `MonitorServiceImpl.MonitorItem` keeps that supplier for as long as the monitor lives. That keeps the first connection's `HostMonitorServiceV3Impl`, its services container, its `PluginService`, and that connection reachable after the connection is dropped, which works against the weak references in `MonitoredConnectionSlot`. efm2 has the same pattern, but since efm3 is meant to be leak-resistant, copying the fields into locals would avoid it:

```suggestion
    final Properties props = this.properties;
    final int detectionTime = this.failureDetectionTimeMillis;
    final int detectionInterval = this.failureDetectionIntervalMillis;
    final int detectionCount = this.failureDetectionCount;
    final long disposalTime = this.monitorDisposalTimeMillis;
    final boolean abortIdle = this.abortIdleConnections;
    final TelemetryCounter counter = this.abortedConnectionsCounter;
    return this.coreMonitorService.runIfAbsent(
        HostMonitorV3Impl.class,
        key,
        this.servicesContainer,
        this.pluginService.getProperties(),
        (monitorServicesContainer) -> new HostMonitorV3Impl(
            monitorServicesContainer,
            hostSpec,
            props,
            detectionTime,
            detectionInterval,
            detectionCount,
            disposalTime,
            abortIdle,
            counter));
```


view thread (39+ messages)  latest in thread

Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621666403@github.com>
Permalink:  ../gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621666403@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox