Skip to content

Commit 5b00195

Browse files
committed
input/async: skip resume and seek if there is a pending error
The resume/seek was received asynchronously and meanwhile an error might have occurred that needs to be handled. This fixes another NFS-related crash bug.
1 parent d1e5c90 commit 5b00195

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/input/AsyncInputStream.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ AsyncInputStream::DeferredResume() noexcept
251251
{
252252
const std::scoped_lock protect{mutex};
253253

254+
if (postponed_exception) {
255+
/* do not proceed, first the caller must handle the
256+
pending error */
257+
caller_cond.notify_one();
258+
InvokeOnAvailable();
259+
return;
260+
}
261+
254262
try {
255263
Resume();
256264
} catch (...) {
@@ -267,6 +275,14 @@ AsyncInputStream::DeferredSeek() noexcept
267275
if (seek_state != SeekState::SCHEDULED)
268276
return;
269277

278+
if (postponed_exception) {
279+
/* do not proceed, first the caller must handle the
280+
pending error */
281+
caller_cond.notify_one();
282+
InvokeOnAvailable();
283+
return;
284+
}
285+
270286
try {
271287
Resume();
272288

0 commit comments

Comments
 (0)