From af17444a1fdbac1a2d568402690a7f93790d912a Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 14 Sep 2021 10:37:14 +1000 Subject: [PATCH] Fix deadlock on write --- .../java/io/quarkus/deployment/console/AeshConsole.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/console/AeshConsole.java b/core/deployment/src/main/java/io/quarkus/deployment/console/AeshConsole.java index d438f50734ba0..268302a729d4f 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/console/AeshConsole.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/console/AeshConsole.java @@ -320,10 +320,10 @@ public void write(boolean errorStream, String s) { } StringBuilder buffer = new StringBuilder(); + if (!shouldWrite(errorStream, s)) { + return; + } synchronized (this) { - if (!shouldWrite(errorStream, s)) { - return; - } if (totalStatusLines == 0) { bottomBlankSpace = 0; //just to be safe, will only happen if status is added then removed, which is not really likely writeQueue.add(s);