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
The uploadFinish variable in runUpload function, downloadFinish variable in runDownload function as well as downloadFinish variable in runDownload functions are updated in unsafe way causing data race when number of threads is greater than one.
Built-in go race detector confirms that (see below). I suggest using WaitGroup to wait for all go routines to finish and calculate time outside of go routines (just after wg.Wait() unblocks).
Not only is there a data race, but the results will be inaccurate for more than one thread. The time of the slowest thread will be used in calculating performance, rather than the time for each thread.
The uploadFinish variable in runUpload function, downloadFinish variable in runDownload function as well as downloadFinish variable in runDownload functions are updated in unsafe way causing data race when number of threads is greater than one.
Built-in go race detector confirms that (see below). I suggest using WaitGroup to wait for all go routines to finish and calculate time outside of go routines (just after wg.Wait() unblocks).
I reported this originally here: https://github.com/minio/s3-benchmark/issues/4 with proposed fix here: https://github.com/minio/s3-benchmark/pull/5, but https://github.com/minio/s3-benchmark maintainers asked to fix it at original repo before they merge the fix.
The text was updated successfully, but these errors were encountered: