forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: protect the registry critical zone when stop/close are called. (e…
…lastic#6959) Changes how the lock is applied to the registry we need to protect the hash until the go routine is starte. Before we were calling `h.add()` inside the goroutine, meaning the following scenario could happend: - Start acquire the look. - Stop request the lock - Goroutine call add, request the lock - Start release the lock - Stop acquire the lock, close all harveter. - Goroutine acquire the lock start harvester. Moving out the `h.add()` of the goroutine make sure when we share the same lock as stop and start. Ref: elastic#6879
- Loading branch information
Showing
2 changed files
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters