[contrib/pzstd] Prevent hangs when there are errors#4080
Conversation
When two threads are using a WorkQueue and the reader thread exits due to an error, it must call WorkQueue::finish() to wake up the writer thread. Otherwise, if the queue is full and the writer thread is waiting for a free slot, it could hang forever. This can happen in pratice when decompressing a large, corrupted file that does not contain pzstd skippable frames.
|
Why is Line 405 in 5dc9c3c I do agree that the changes in |
|
OK, I see what's going on now. In both The only remaining question I have is whether it's safe to |
|
OK, I don't see any reason why we can't call LGTM. |
When two threads are using a WorkQueue and the reader thread exits due to an error, it must call WorkQueue::finish() to wake up the writer thread. Otherwise, if the queue is full and the writer thread is waiting for a free slot, it could hang forever.
This can happen in pratice when decompressing a large, corrupted file that does not contain pzstd skippable frames.