Skip to content

Commit 9093c21

Browse files
gastaldigsmet
authored andcommitted
Fix infinite loop in AeshConsole.deadlockSafeWrite() during dev mode shutdown
When connectionLock.tryLock() fails, the for(;;) loop spins indefinitely. This occurs during shutdown when the Console Shutdown Hook holds the lock while another thread (e.g. application shutdown firing ShutdownEvent) tries to log through AeshConsole. Return immediately when tryLock() fails since the lock-holding thread already drains the entire queue. (cherry picked from commit 1b04918)
1 parent dad764b commit 9093c21

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/deployment/src/main/java/io/quarkus/deployment/console/AeshConsole.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ private void deadlockSafeWrite() {
197197
IN_WRITE.set(false);
198198
connectionLock.unlock();
199199
}
200+
} else {
201+
//another thread holds the lock; it will drain the queue
202+
return;
200203
}
201204
}
202205
}

0 commit comments

Comments
 (0)