You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
0 commit comments