Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
dougqh
force-pushed
the
dougqh/classlatch-jms
branch
from
October 1, 2026 22:52
8412459 to
0520d13
Compare
dougqh
commented
Oct 2, 2026
Replaces the per-call AbstractMethodError catch (JMS <=1.1 producers lack getDestination) with a ClassLatch so the error is paid once per class instead of once per call. Distinguishes a producer's legitimate null destination from a latched/unavailable method via isLatched, since both can otherwise look identical. Part of APMLP-1895; stacked on #12702 (ClassLatch). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Uses ClassLatch's fallback hook so getDestination is a single tryApplyOrNull, with no isLatched re-check to tell a skipped call from an anonymous producer's real null. An AbstractMethodError that does not name the producer's class now also takes the fallback, as it did before the conversion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh
force-pushed
the
dougqh/classlatch-jms
branch
from
October 2, 2026 01:18
0520d13 to
39df7a5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Converts
JMSDecorator.getDestination'scatch (AbstractMethodError)fallback (JMS<=1.1producers lackgetDestination) to useClassLatch, so the error is paid once per class rather than once per call, matching the pattern established in #12702 forJDBCDecorator.One of the candidate sites scanned in APMLP-1895. Draft/trial PR to see how the conversion holds up for this call site.
Stacked on #12702 (ClassLatch) — not mergeable until that lands.
The
<=1.1getQueue/getTopicfallback lives in the latch'sfallbackoverride (added toClassLatchin #12702), sogetDestinationis a singletryApplyOrNullcall. This also settles a correctness nuance:MessageProducer.getDestination()legitimately returnsnullfor a producer created with an unidentified destination (session.createProducer(null)), which must not be confused with a latched/unavailable method — otherwise a plainMessageProducercould hit the(TopicPublisher) ... .getTopic()cast and throwClassCastException. With the fallback inside the latch, a realnullis returned as-is and only a failed or latched call takes the fallback, with noisLatchedre-check at the call site.Behavior changes
Compared to the original
catch (AbstractMethodError):UnsupportedOperationExceptionfromgetDestination()now takes thegetQueue/getTopicfallback (never latched, since it can't be attributed to a class) instead of propagating to the caller.nullproducer now yieldsnullinstead of throwingNullPointerException.AbstractMethodErrorwhose message does not name the producer's class (e.g. thrown inside a wrapper's delegate) still takes the fallback, as before, but does not latch the class.Test plan
JMSDecoratorGetDestinationTest(Proxy-based mocks, per theParseDBInfoClientInfoTestprecedent): real-destination passthrough, real-null passthrough for a plain producer,AbstractMethodErrorfallback toQueueSender.getQueue()with latching confirmed on a second call, fallback toTopicPublisher.getTopic(), fallback without latching for an error naming another class, and latch isolation across different proxy classes../gradlew :dd-java-agent:instrumentation:jms:javax-jms-1.1:teston JDK 8 and JDK 11 (before the fallback rework)🤖 Generated with Claude Code