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
{{ message }}
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
While working on some tests to detect race conditions with a blockstore wrapper I'm working on, I create multiple goroutines to execute the various blockstore functions. I noticed that when I had each goroutine call Blockstore::HashOnRead(num%2==0) where num is the goroutine number, that a race condition is triggered.
Subsequently I looked into the blockstore and found this:
This seems a little unsafe, since there's no documentation explicitly saying that this shouldn't be called by multiple goroutines. It should either be guarded by a mutex, or, alternatively use an atomic boolean
edit:
Doing some more digging, this race condition will not only effect HashOnRead, but also Get, GetSize
The text was updated successfully, but these errors were encountered:
While working on some tests to detect race conditions with a blockstore wrapper I'm working on, I create multiple goroutines to execute the various blockstore functions. I noticed that when I had each goroutine call
Blockstore::HashOnRead(num%2==0)
wherenum
is the goroutine number, that a race condition is triggered.Subsequently I looked into the blockstore and found this:
This seems a little unsafe, since there's no documentation explicitly saying that this shouldn't be called by multiple goroutines. It should either be guarded by a mutex, or, alternatively use an atomic boolean
edit:
Doing some more digging, this race condition will not only effect
HashOnRead
, but alsoGet
,GetSize
The text was updated successfully, but these errors were encountered: