Potential deadlock in acquiring chunk locks for features chunks
Gegy opened this issue ยท 2 comments
From what I can tell, there seems to be the potential for a deadlock to occur when acquiring chunk locks for loading the features chunk status. This can happen given locks are acquired sequentially: if two chunks are acquiring the same locks at the same time, they can end up in a state where they both have acquired some of their locks, but the other thread holds the rest that they need. This causes no progression to be possible, given they are both waiting on each other to release the locks.
Working around this would require atomically ensuring that all locks are available before acquisition, but I'm not sure how this would work with the asyncutil
library.
Locks are not acquired synchronously though: the thread will yield to other tasks if it encounters an acquired lock.