Skip to content

fix(ssestream): synchronize decoder registry access - #892

Open
tvost2 wants to merge 1 commit into
openai:mainfrom
tvost2:fix/ssestream-decoder-registry-race
Open

fix(ssestream): synchronize decoder registry access#892
tvost2 wants to merge 1 commit into
openai:mainfrom
tvost2:fix/ssestream-decoder-registry-race

Conversation

@tvost2

@tvost2 tvost2 commented Sep 4, 2026

Copy link
Copy Markdown

Fixes #886

RegisterDecoder and NewDecoder accessed the package-level decoder registry without synchronization, allowing concurrent map writes and race detector failures. Protect registry reads and writes with an RWMutex and add concurrent coverage.

Validation:

  • go test -race ./packages/ssestream
  • go test ./packages/ssestream
  • go test ./... (fails in existing tests because the localhost:4010 mock server is not running; also TestMultipartFilenameMetadata/backslash fails independently)

@tvost2
tvost2 requested a review from a team as a code owner September 4, 2026 21:32
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.

RegisterDecoder races with concurrent stream decoding

1 participant