Skip to content

fix data race in error logs for replication#682

Open
tgross wants to merge 1 commit into
mainfrom
fix-logging-data-races
Open

fix data race in error logs for replication#682
tgross wants to merge 1 commit into
mainfrom
fix-logging-data-races

Conversation

@tgross
Copy link
Copy Markdown
Member

@tgross tgross commented May 19, 2026

We have a few places in replication where we log error messages that reference a peer from a followerReplication. We aren't taking a read lock here, so there's a data race if the address for a peer changes. Take the read lock around these logs.

Ref: https://github.com/hashicorp/raft/actions/runs/25408067027/job/74874567387?pr=678 from #678
Fixes: #681

We have a few places in replication where we log error messages that reference a
peer from a `followerReplication`. We aren't taking a read lock here, so
there's a data race if the address for a peer changes. Take the read lock around
these logs.

Fixes: #681
@tgross tgross marked this pull request as ready for review May 19, 2026 15:46
@tgross tgross requested review from a team as code owners May 19, 2026 15:46
@tgross tgross removed the request for review from a team June 1, 2026 16:18
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.

data race in TestRaft_ReplaceUpgrade back compat test

1 participant