qos-ch / logback

The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
Other
2.97k stars 1.28k forks source link

All threads blocked #786

Open koszta5 opened 5 months ago

koszta5 commented 5 months ago

Logback version :1.2.11 Springboot version: 2.7.4

Apparently in some cases all locks are lost and logback is just "stuck" - only restart helps. Thread dump is attached StuckLogback.threads.txt

All threads remain in this state WAITING for lock endlessly `"http-nio-8184-exec-1" #139 daemon prio=5 os_prio=0 cpu=53544.34ms elapsed=232090.85s tid=0x00002af5d1b77800 nid=0x15fe7 waiting on condition [0x00002af676207000] java.lang.Thread.State: WAITING (parking) at jdk.internal.misc.Unsafe.park(java.base@11.0.19/Native Method)

This bug is very closely related to issue originally reported here: https://jira.qos.ch/projects/LOGBACK/issues/LOGBACK-1406?filter=allopenissues (same thing really). It is also similar to this: https://github.com/qos-ch/logback/issues/767

sunl888 commented 4 months ago

I also encountered this issue, it will be resolved after restarting jstack.txt

koszta5 commented 4 months ago

well that is not resolving this problem :(

ceki commented 4 months ago

@koszta5 Under which JDK version is this occurring?

koszta5 commented 4 months ago

openjdk version "11.0.19" 2023-04-18 OpenJDK Runtime Environment Temurin-11.0.19+7 (build 11.0.19+7) OpenJDK 64-Bit Server VM Temurin-11.0.19+7 (build 11.0.19+7, mixed mode)

jinshuai86 commented 4 months ago

@koszta5 Under which JDK version is this occurring?

Can you take a look at the problem in the link? https://jira.qos.ch/browse/LOGBACK-1406

It's very similar to this issue, I've also encountered this problem. only one thread(Thread 507 belows) BLOCKED in FileOutputStream.writeBytes() , other threads(Thread 402 belows) BLOCKED in OutputStreamAppender.subAppend()

Thread 507: (state = BLOCKED)

Thread 402: (state = BLOCKED)

koszta5 commented 3 months ago

Sorry, but no - if you examine e.g. my very recent thread dump here: https://jstack.review/

You will find out that all my threads are simply WAITING for a lock that is now lost (no other thread is holding it) stuckLogback.threads.txt

Lock 0x0000000701dc5ff0 is completely lost to the JVM :( Causing the whole app to get stuck

ceki commented 2 weeks ago

@koszta5 The 1.2 branch is about 8 years old now. Would it be possible for your to upgrade to logback 1.5?

apflieger commented 2 weeks ago

I had this problem on 1.4.11 and rollbacked our virtual thread migration. We couldn't reproduce the crash so while I can upgrade to 1.5, I can't test virtual threads again blindly