Add concurrency failure-harness checks - #14
Closed
lucarlig wants to merge 1 commit into
Closed
Conversation
lucarlig
force-pushed
the
user/luca/concurrency-ci-failure
branch
4 times, most recently
from
May 15, 2026 10:08
29e9d57 to
8022cc0
Compare
lucarlig
force-pushed
the
user/luca/concurrency-ci-failure
branch
from
May 15, 2026 10:19
8022cc0 to
d75bf46
Compare
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/concurrency-ci-failure
branch
from
May 15, 2026 10:27
d75bf46 to
4e65148
Compare
Contributor
Author
|
@dawid-nowak what do you think about |
Contributor
|
I haven't looked into it to be honest. Let's leave it hanging it might be useful. |
Contributor
Author
|
this is legacy at this point not relevant for sessionless |
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
Adds dedicated Loom/Miri checks for concurrency and interpreter-friendly regression coverage.
This PR intentionally does not fix the issues the suite exposes. It only adds the test harness and CI jobs so the failures are visible and reproducible.
No test-only public API or
internal-test-hooksfeature is exposed. Loom uses a normalloomCargo feature. Miri usescfg(miri).Test layout
Reproduce from main
Run the Loom check:
cargo test --locked -p contextforge-gateway-rs-lib \ --features loom \ gateway::session_manager::concurrencyExpected result: 3 pass, 1 fail.
Run the Miri checks:
cargo +nightly miri setup cargo +nightly miri test --locked -p contextforge-gateway-rs-lib miri_checksExpected result: 4 pass, 2 fail.
Regression coverage map
Every issue called out below has a regression test in this PR.
gateway::session_manager::concurrency::concurrent_borrowers_do_not_erase_returned_transportcargo test --locked -p contextforge-gateway-rs-lib --features loom gateway::session_manager::concurrencygateway::mcp_gateway::miri_checks::longest_backend_prefix_wins_for_toolscargo +nightly miri test --locked -p contextforge-gateway-rs-lib miri_checksgateway::mcp_gateway::miri_checks::longest_backend_prefix_wins_for_resourcescargo +nightly miri test --locked -p contextforge-gateway-rs-lib miri_checksAdditional non-failing coverage in the suite:
gateway::session_manager::concurrency::cleanup_does_not_resurrect_returned_transportgateway::session_manager::concurrency::different_sessions_do_not_interferegateway::session_manager::concurrency::multiple_backends_preserve_unborrowed_servicesgateway::mcp_gateway::miri_checks::missing_separator_does_not_matchgateway::mcp_gateway::miri_checks::hyphen_and_underscore_backend_names_are_distinctgateway::session_store::miri_checks::session_mapping_msgpack_round_tripgateway::session_store::miri_checks::user_session_key_msgpack_round_tripIssues exposed
1. Concurrent session return can erase a live backend service
Concurrent calls for the same downstream MCP session can erase a live backend service in
SessionManager.Bad interleaving:
backend-a, so the map temporarily storesNone.None.Noneand overwrites the real service.Observed Loom failure:
2. Overlapping backend prefixes can route to the wrong backend
Backend tool/resource names are split by matching the first backend-name prefix. If one backend name prefixes another, the shorter name can be selected first.
Example:
Bad parse:
Correct parse:
Observed Miri test failures: