Skip to content

Conversation

@jba
Copy link
Contributor

@jba jba commented Aug 9, 2025

In jsonprc2_test.go, binder.Bind starts a goroutine. That goroutine begins to run during jsonrpc2.bindConnection, and can race with the setting of conn.write in bindConnection.

This PR adds a sleep, which is a poor way to deal with the race, but the least invasive change. Better ones include running the test function after Dial returns, or adding a Connection.Ready method to detect when initialization is complete.

In jsonprc2_test.go, binder.Bind starts a goroutine.
That goroutine begins to run during jsonrpc2.bindConnection, and
can race with the setting of conn.write in bindConnection.

This PR adds a sleep, which is a poor way to deal with the race, but
the least invasive change. Better ones include running the test
function after Dial returns, or adding a Connection.Ready method
to detect when initialization is complete.
@jba jba requested a review from findleyr August 9, 2025 16:19
@findleyr
Copy link
Contributor

findleyr commented Aug 9, 2025

Ok for now, thanks. I'll investigate a proper fix.

@findleyr findleyr merged commit be1ddf5 into modelcontextprotocol:main Aug 9, 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