-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-3950] support conc generateCert invocations
usage of gossip/comm/crypto.go:GenerateCertificates is prone to race conditions problems if it's used with the same parameters for file names. The method is used only in test code, but the tests run concurrently. Because the function that invokes GenerateCertificates usually uses the same file name as parameter and adds defer os.Remove() on the file names, and as a result - if it's used concurrently you may have a race condition in which one goroutine deletes the files that the other goroutine uses to read from. I changed the code to do both generation, removal and loading in the same method. The generation uses a random file name so concurrent invocations can now be used. Change-Id: I6742b4ca0347bcc868f3df5a429c34bd8098d505 Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
- Loading branch information
Showing
5 changed files
with
47 additions
and
92 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
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
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