-
Couldn't load subscription status.
- Fork 41
Open
Description
Calling OrderedWalk alongside with other dag operations may lead to deadlock as described in this issue
OrderedWalk acquires an RLock and calls GetParents that is also acquiring an RLock.
This may lead to deadlocks if another goroutine acquires a RWLock in the meantime. The rwmutex documentation clearly explains that pitfall:
If any goroutine calls RWMutex.Lock while the lock is already held by one or more readers,
concurrent calls to RWMutex.RLock will block until the writer has acquired (and released) the lock,
to ensure that the lock eventually becomes available to the writer. Note that this prohibits
recursive read-locking. A RWMutex.RLock cannot be upgraded into a RWMutex.Lock, nor can a
RWMutex.Lock be downgraded into a RWMutex.RLock.
Rlock function doc also explicitely stands that:
It should not be used for recursive read locking; a blocked Lock
call excludes new readers from acquiring the lock. See the
documentation on the [RWMutex] type.
Metadata
Metadata
Assignees
Labels
No labels