Skip to content

Fix decoder cache publication race - #582

Open
tirathawat wants to merge 1 commit into
goccy:masterfrom
tirathawat:fix/issue-495-decoder-cache
Open

Fix decoder cache publication race#582
tirathawat wants to merge 1 commit into
goccy:masterfrom
tirathawat:fix/issue-495-decoder-cache

Conversation

@tirathawat

@tirathawat tirathawat commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • make decoder fast-cache publication atomic to avoid torn Decoder interface reads under concurrent first use
  • share the same atomic cache path between race and non-race decoder builds
  • add regression coverage for issue enconter panic when calling unmarshal() #495 and internal cache winner behavior

Test Plan

  • go test -count=1 ./...
  • go test -race -count=1 ./...
  • go test -count=100 ./internal/decoder -run 'TestDecoderFastCache'
  • go test -count=100 . -run TestIssue495

Fixes #495

@tirathawat

Copy link
Copy Markdown
Author

Hi @goccy, this PR fixes #495 by making decoder cache publication atomic. Could you take a look when you have time?

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.

enconter panic when calling unmarshal()

2 participants