Repository navigation
fix: in-flight key, staged write timeout, test seeds - #915
Merged
Merged
Conversation
Thread ids are unique per server, not across servers, so two connections to different servers could both register thread N: the second replaced the first, and the first finishing removed the second. Key by (connection id, thread id), and give each registration a token so a late drop on a reused pooled connection cannot remove a newer entry. The executor now registers through the same ticket as the tracker. Closes #901. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
StagedWrite::begin_in ran the agent's write without the connection's query_timeout_secs, so a long staged write nobody cancelled held its connection and locks unbounded. It now takes the timeout and applies it as the executor does: on expiry it sends KILL QUERY from a second pool connection, lets the statement end with the server's interrupted error, rolls back and returns the executor's timeout error. The MCP workspace passes the connection's timeout. Closes #902. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The shared test containers bind-mounted the seed SQL from whichever checkout created them, so removing that checkout broke `docker start`. MySQL 8, MariaDB 11 and the unused 5.7 service now build a small image that copies tests/fixtures/sql/ into /docker-entrypoint-initdb.d/, and `db-reset` rebuilds the images so a changed seed file is picked up. The SSL service keeps its mounts: its certificates are generated locally and are not in git. Closes #903. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
Merged
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.
Follow-ups to #900, done by the
implementer-rustlane.Closes #901, #902, #903.
Changes
InFlightMap(mas-core/src/query/in_flight.rs) is keyed by(connection_id, thread_id), so two connections whose server threads share a number no longer overwrite each other.InFlightGuardis gone; it now registers through the same ticket.StagedWrite::begin_intakestimeout: Option<Duration>. When the timeout expires, it sendsKILL QUERYfrom a second connection, rolls back, and returns the sameCoreError::Timeoutthe executor returns.stage_writepasses the connection's query timeout.docker-compose.test.yml, the MySQL and MariaDB containers build images with the seed SQL copied in, so no checkout path is bind-mounted. The SSL service keeps its mounts, because its certificates are generated locally.just db-resetrebuilds the images.CONTRIBUTING.mdand theintegration-testsskill. Therun_writerow inAI_INTEGRATION.mdnow says the statement is bounded by the query timeout.Tests
a_staged_write_stops_at_the_connections_query_timeout. It fails after 20 s with the timeout forced off, and passes with the fix.cargo fmt,clippy -D warnings, andcargo testfor mas-core, sqlpilot and mas-mcp all pass.cargo test -p mas-core -- --ignored: 193 passed on MySQL (13306) and 193 on MariaDB (13308).Generated by Claude Code