Merge pull request #3909 from hashicorp/b-node-attributes-concurrent-access

Fingerprinters accessing node information should be thread safe
This commit is contained in:
Chelsea Komlo 2018-03-06 11:57:46 -05:00 committed by GitHub
commit bd88877249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,7 +100,12 @@ func (fm *FingerprintManager) setupDrivers(drivers []string) error {
func (fm *FingerprintManager) fingerprint(name string, f fingerprint.Fingerprint) (bool, error) {
request := &cstructs.FingerprintRequest{Config: fm.getConfig(), Node: fm.node}
var response cstructs.FingerprintResponse
if err := f.Fingerprint(request, &response); err != nil {
fm.nodeLock.Lock()
err := f.Fingerprint(request, &response)
fm.nodeLock.Unlock()
if err != nil {
return false, err
}