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:16:11 +0000
Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621610397@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:126)

When the cached monitor turns out to be stopped, this method calls `stopAndRemove(key)` unconditionally. That can stop and evict a new monitor that another thread has just installed under the same key.

Example: threads A and B both get the stopped monitor M1. A's `M1.register` fails, A calls `stopAndRemove(key)`, `runIfAbsent` creates M2, and A's slot registers with M2. Then B's `M1.register` fails, B calls `stopAndRemove(key)`, which stops and removes M2, and B creates M3. A's slot now points at the stopped M2, so A's in-flight call runs unmonitored and a hung query isn't aborted.

Should the entry be removed only if the cached monitor is still the stopped instance that was observed? `MonitorService` doesn't have a conditional remove yet, so this might need a small `remove(class, key, expected)` addition.


view thread (39+ messages)  latest in thread

Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621610397@github.com>
Permalink:  ../gh-aws-aws-advanced-jdbc-wrapper-2237-rc4621610397@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