Skip to content

confluent: fix data race on shutSig in schema registry encoder#4298

Open
mmatczuk wants to merge 1 commit intomainfrom
mmt/confluent-fixes-v2
Open

confluent: fix data race on shutSig in schema registry encoder#4298
mmatczuk wants to merge 1 commit intomainfrom
mmt/confluent-fixes-v2

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

Commits

  • fix data race on shutSig in schema registry encoder

Jira

  • CON-412

The background goroutine started by newSchemaRegistryEncoder re-reads
s.shutSig on every loop iteration. When newSchemaRegistryEncoderFromConfig
replaces s.shutSig with a new signaller, there is a concurrent read/write
race. Capture shutSig in a local variable before launching the goroutine
so it never re-reads the struct field.

Fixes CON-412
@claude
Copy link
Copy Markdown

claude Bot commented Apr 20, 2026

Commits
LGTM

Review
Minimal, focused fix that captures s.shutSig in a local variable before launching the background refresh goroutine, so it no longer races with the replacement of s.shutSig in newSchemaRegistryEncoderFromConfig. The old signaller is still triggered via TriggerSoftStop() before replacement, so the goroutine exits cleanly.

LGTM

This was referenced Apr 20, 2026
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.

1 participant