Repository navigation
Drop a report whose tags map cannot be read instead of throwing - #38
Merged
Merged
Conversation
report() copied and serialized the caller's map on the caller's thread with nothing around it, so a map another thread was changing threw ConcurrentModificationException into the host program, and a raw map holding a non-String threw ClassCastException. Both now drop that one report, silently like the other drops on that thread, since a logging handler may do IO there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (scored against the diff and CI run 41829012617, head 5248039):
Observations:
Summary: no blocking findings. The fix is proven by a recorded fail-then-pass, CI is green on all three JDKs, and no do-not-auto-merge path matches this diff. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
report(String, Double, Map)could throw into the host program, against the "never throws" promise. The caller'stagsmap was copied bywithVersionand serialized byjson()on the caller's thread with no guard, so a map being changed by another thread escaped asConcurrentModificationException, and a raw map holding a non-Stringescaped asClassCastException.catch (RuntimeException ...), and the one report is dropped. The client keeps working afterwards.report()runs on the host's thread, where aHandlermay do IO, and the two existing drops on that path (a full queue, too many counted events) are silent for the same reason.reportpromises" table, the class Javadoc, thereportJavadoc and theBuilder.loggerJavadoc now say so.Closes #37
Merge gate
The do-not-auto-merge list was checked against this diff: the wire format,
REASON_*/ENV_*, the opt-out precedence,QUEUE_CAPACITY, the timeouts,SERVER_WIDE_CONFIG_CONTENT,pom.xml, the version strings and the README "Opting out" and "Keys" sections are all untouched. A report with readable tags produces the same bytes as before.Deferred issues
Test plan
report_aTagsMapChangedMidReadIsDroppedWithoutThrowingandreport_aNonStringTagSmuggledInByARawMapIsDroppedWithoutThrowingfail withTraceClient.javastashed and pass with it restored.mvn -B verify(Java 21): 99 tests run, 0 failures (97 before).CI does not run the client inside a real Spigot server. The fix depends on no host behaviour, so no manual smoke test is called for.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson