Skip to content

Conversation

@findleyr
Copy link
Contributor

@findleyr findleyr commented Aug 5, 2025

This PR contains two commits. The first adds race tests to our build matrix, inspired by #227. While the race in #227 is a logical race, not a data race, it is still the case that the slower timing of race tests made it more reproducible with the race detector enabled.

The second commit fixes the bug in the streamable server transport, by checking outstanding requests in the same critical section as acquiring data to write.

This CL makes the following changes to our Github workflows, motivated
by modelcontextprotocol#227:

- Add -race tests.
- Add go1.25rc2 to the build matrix.
- Check out code before setting up Go, so that the setup step can use
  dependency caching.
As reported in modelcontextprotocol#227, there was a race where streams could be terminated
before the final reply was written. Fix this by checking the number of
outstanding requests in the same critical section that acquires outgoing
messages to write.

Fixes modelcontextprotocol#227
@findleyr findleyr requested review from jba and samthanawalla August 5, 2025 14:54
@findleyr findleyr marked this pull request as ready for review August 5, 2025 14:55
@findleyr findleyr changed the title .github: add race and 1.25 tests mcp: add race and 1.25 tests, fix a bug in streamable transport Aug 5, 2025
@findleyr findleyr merged commit f4a9396 into modelcontextprotocol:main Aug 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants