Server-rest: serialise endpoint route registration in MajordomoRestPlugin - #274
Open
t0susnik wants to merge 1 commit into
Open
Server-rest: serialise endpoint route registration in MajordomoRestPlugin#274t0susnik wants to merge 1 commit into
t0susnik wants to merge 1 commit into
Conversation
…ugin In registerEndPoint() registeredEndpoints.computeIfAbsent() only de-duplicates the same endpoint key; it does not serialise different endpoints against each other. start() registers endpoints from two independent threads (the initial synchronous enumeration and the async service-subscription listener), both mutating Javalin's shared, non-thread-safe route table. This caused a ConcurrentModificationException / IllegalArgumentException race. Signed-off-by: Tomaž Sušnik <tomaz.susnik@cosylab.com>
t0susnik
force-pushed
the
fix/rest-plugin-endpoint-registration-race
branch
from
August 13, 2026 13:31
28a0526 to
bbdb8d6
Compare
RalphSteinhagen
approved these changes
Aug 14, 2026
t0susnik
had a problem deploying
to
configure coverage
August 14, 2026 05:40 — with
GitHub Actions
Error
t0susnik
had a problem deploying
to
configure coverage
August 14, 2026 05:40 — with
GitHub Actions
Failure
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.
Fixes #275
Fixing a race condition in
MajordomoRestPlugin.registerEndPoint()that causedMajordomoRestPluginTeststo fail randomly in CI with:ConcurrentModificationException / IllegalArgumentException: already existsThe fix protects concurrent endpoint registration against the same Javalin instance,
be it from different threads within one REST plugin or from multiple REST plugin
instances sharing the same JVM-wide
RestServer.getInstance().Verified: reliably reproduced within ~10 runs before the fix, 0 recurrences in 8 runs after.