Skip to content

Commit

Permalink
fix(sync): fix data race when pinging registries by read-locking (#1924)
Browse files Browse the repository at this point in the history
Signed-off-by: Petu Eusebiu <[email protected]>
  • Loading branch information
eusebiu-constantin-petu-dbk authored Oct 12, 2023
1 parent 556c066 commit 04048e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/extensions/sync/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (httpClient *Client) SetConfig(config Config) error {
}

func (httpClient *Client) Ping() bool {
httpClient.lock.RLock()
defer httpClient.lock.RUnlock()

pingURL := *httpClient.url

pingURL = *pingURL.JoinPath("/v2/")
Expand Down

0 comments on commit 04048e5

Please sign in to comment.