hashicorp / hashicorp/consul

Add a lock for persisting service/check state to avoid a race

Open
#2,495 0 comments 0 reactions 0 assignees View on GitHub
theme/internal-cleanup type/bug
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

Right now the persistService/persistCheck functions can be called concurrently for the same service and attempt to update the same file on disk at the same time, resulting in undefined behavior. If we use a lock, we can make sure the later update is persisted.

Contributor guide

Open the contributing guide

Research direction

Start by locating the persistService and persistCheck functions and examining how they update their on-disk state files. Reproduce or inspect concurrent calls for the same service, then verify that updates are serialized and the later update is persisted without undefined file behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.