discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.35k stars 734 forks source link

IllegalStateException: Could not acquire lock in reasonable timeframe #1700

Closed nxtByte closed 2 years ago

nxtByte commented 3 years ago

Hey, this is basically a duplicate of #1696 but as it was already closed, I couldn't provide the thread dump any more, so I opened another ticket. As already mentioned there, the bot regularly has IllegalStateExceptions as shown below. I'd be glad if you could help me out with this issue. Short explanation of the bot I coded: the bot is a music bot, that plays music in a VC and also displays the current member count of a guild by changing the name of a given channel. It has a few other features, but these don't matter for resolving the issue. The issue occured since I added the member count feature (which btw works flawlessly, even after the exception). But for some reason, when the exception occurs, the bot stops playing music and can't leave or join any voice channels any more. I have to manually stop the whole JVM and re-start it, so it works again.

Exception: image

Thread Dump:

2021-06-30 19:37:08
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.291-b10 mixed mode):

"JDA MainWS-WriteThread" #1492 prio=5 os_prio=0 tid=0x000002b97ea64000 nid=0x1230 in Object.wait() [0x000000dd966fe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at com.neovisionaries.ws.client.WritingThread.waitForFrames(WritingThread.java:305)
        - locked <0x00000000bafbe4a8> (a com.neovisionaries.ws.client.WritingThread)
        at com.neovisionaries.ws.client.WritingThread.main(WritingThread.java:89)
        at com.neovisionaries.ws.client.WritingThread.runMain(WritingThread.java:55)
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

"JDA MainWS-ReadThread" #1491 prio=5 os_prio=0 tid=0x000002b97ea60800 nid=0x134 runnable [0x000000dd941fe000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
        at sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
        at sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readApplicationRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.access$300(Unknown Source)
        at sun.security.ssl.SSLSocketImpl$AppInputStream.read(Unknown Source)
        - locked <0x00000000bb21d340> (a sun.security.ssl.SSLSocketImpl$AppInputStream)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        - locked <0x00000000bafb28e8> (a java.io.BufferedInputStream)
        at java.io.FilterInputStream.read(Unknown Source)
        at com.neovisionaries.ws.client.WebSocketInputStream.readBytes(WebSocketInputStream.java:165)
        at com.neovisionaries.ws.client.WebSocketInputStream.readFrame(WebSocketInputStream.java:46)
        at com.neovisionaries.ws.client.ReadingThread.readFrame(ReadingThread.java:338)
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:99)
        at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

"Timer-6" #1015 daemon prio=5 os_prio=0 tid=0x000002b97ea65800 nid=0x15f0 in Object.wait() [0x000000dd940ff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.util.TimerThread.mainLoop(Unknown Source)
        - locked <0x00000000998006d8> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Unknown Source)

"Thread-44" #98 daemon prio=7 os_prio=1 tid=0x000002b97ea5e000 nid=0x10e0 runnable [0x000000dd97aff000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.process(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.process(UdpQueueManager.java:84)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory$$Lambda$166/622327768.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-native-udp-4-thread-1" #97 daemon prio=5 os_prio=0 tid=0x000002b97ea63800 nid=0xa40 runnable [0x000000dd977fe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080264538> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Timer-4" #75 prio=5 os_prio=0 tid=0x000002b97ea5d000 nid=0x88c in Object.wait() [0x000000dd96cff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x0000000080264780> (a java.util.TaskQueue)
        at java.lang.Object.wait(Unknown Source)
        at java.util.TimerThread.mainLoop(Unknown Source)
        - locked <0x0000000080264780> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Unknown Source)

"lava-daemon-pool-playback-1-thread-1" #54 daemon prio=5 os_prio=0 tid=0x000002b97ea61000 nid=0x149c waiting on condition [0x000000dd979fe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080971d90> (a java.util.concurrent.SynchronousQueue$TransferStack)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
        at java.util.concurrent.SynchronousQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA AudioLifeCycle-Worker 1" #51 daemon prio=5 os_prio=0 tid=0x000002b97ea5c800 nid=0xb80 runnable [0x000000dd97cfe000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.destroy(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.freeResources(UdpQueueManager.java:91)
        - locked <0x0000000080264378> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.closeInternal(NativeResourceHolder.java:43)
        - locked <0x0000000080264388> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.close(NativeResourceHolder.java:29)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.shutdownQueueManager(NativeAudioSendFactory.java:51)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.removeInstance(NativeAudioSendFactory.java:79)
        - locked <0x00000000806f5ea0> (a java.lang.Object)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendSystem.shutdown(NativeAudioSendSystem.java:28)
        at net.dv8tion.jda.internal.audio.AudioConnection.shutdown(AudioConnection.java:177)
        - locked <0x00000000802a2828> (a net.dv8tion.jda.internal.audio.AudioConnection)
        at net.dv8tion.jda.internal.audio.AudioConnection.close(AudioConnection.java:169)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$1(AudioManagerImpl.java:133)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$185/1599736865.run(Unknown Source)
        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:146)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.closeAudioConnection(AudioManagerImpl.java:130)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$0(AudioManagerImpl.java:124)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$184/730336045.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-info-loader-2-thread-1" #41 daemon prio=5 os_prio=0 tid=0x000002b97ea62800 nid=0x6e8 waiting on condition [0x000000dd978fe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000801e8ed8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-manager-3-thread-1" #38 daemon prio=5 os_prio=0 tid=0x000002b97e639800 nid=0x468 waiting on condition [0x000000dd975ff000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000801e9158> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA RateLimit-Worker 5" #37 prio=5 os_prio=0 tid=0x000002b97e63f800 nid=0x60 waiting on condition [0x000000dd974ff000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080493150> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA RateLimit-Worker 4" #36 prio=5 os_prio=0 tid=0x000002b97e63e800 nid=0xf28 waiting on condition [0x000000dd973ff000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080493150> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Abandoned connection cleanup thread" #35 daemon prio=5 os_prio=0 tid=0x000002b97e63c800 nid=0x157c in Object.wait() [0x000000dd96efe000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000800e0448> (a java.lang.ref.ReferenceQueue$Lock)
        at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:70)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"DestroyJavaVM" #27 prio=5 os_prio=0 tid=0x000002b97e63b000 nid=0x13e4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"UC-Loop" #26 prio=5 os_prio=0 tid=0x000002b97e63e000 nid=0x5a8 runnable [0x000000dd970fe000]
   java.lang.Thread.State: RUNNABLE
        at de.nxtbyte.prionity.utils.UserCountManager.lambda$runLoop$0(UserCountManager.java:28)
        at de.nxtbyte.prionity.utils.UserCountManager$$Lambda$62/1848415041.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA Gateway-Worker 1" #24 daemon prio=5 os_prio=0 tid=0x000002b97e63b800 nid=0x7d0 runnable [0x000000dd96ffe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080492f10> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA RateLimit-Worker 3" #22 prio=5 os_prio=0 tid=0x000002b97e537800 nid=0x1148 waiting on condition [0x000000dd96dfe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080493150> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA RateLimit-Worker 2" #15 prio=5 os_prio=0 tid=0x000002b97e222800 nid=0xde8 waiting on condition [0x000000dd965fe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080493150> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA RateLimit-Worker 1" #14 prio=5 os_prio=0 tid=0x000002b97e362800 nid=0x600 waiting on condition [0x000000dd964ff000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000080493150> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x000002b97d0e5000 nid=0x17a8 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=2 tid=0x000002b97d06a800 nid=0x1608 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=2 tid=0x000002b97d062000 nid=0xddc waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=2 tid=0x000002b97d059800 nid=0x680 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=2 tid=0x000002b97d059000 nid=0x90 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" #6 daemon prio=5 os_prio=2 tid=0x000002b97d050000 nid=0xb58 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #5 daemon prio=9 os_prio=2 tid=0x000002b97d04f000 nid=0x16a8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Surrogate Locker Thread (Concurrent GC)" #4 daemon prio=9 os_prio=0 tid=0x000002b97d04e800 nid=0x161c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x000002b97d01d000 nid=0xfe4 in Object.wait() [0x000000dd95aff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x0000000080494f70> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x000002b97d014800 nid=0xee0 in Object.wait() [0x000000dd959fe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.lang.ref.Reference.tryHandlePending(Unknown Source)
        - locked <0x0000000080495128> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)

"VM Thread" os_prio=2 tid=0x000002b97cfef000 nid=0xc84 runnable

"Gang worker#0 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726bb800 nid=0xfb4 runnable

"Gang worker#1 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726bd000 nid=0x131c runnable

"Gang worker#2 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726be800 nid=0xe54 runnable

"Gang worker#3 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726c0800 nid=0xff4 runnable

"Gang worker#4 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726c2000 nid=0x870 runnable

"Gang worker#5 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726c4000 nid=0xcac runnable

"Gang worker#6 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726c7000 nid=0xc18 runnable

"Gang worker#7 (Parallel GC Threads)" os_prio=2 tid=0x000002b9726c8800 nid=0x1414 runnable

"G1 Main Concurrent Mark GC Thread" os_prio=2 tid=0x000002b972709800 nid=0x1240 runnable

"Gang worker#0 (G1 Parallel Marking Threads)" os_prio=2 tid=0x000002b97270b800 nid=0x358 runnable

"Gang worker#1 (G1 Parallel Marking Threads)" os_prio=2 tid=0x000002b97270c800 nid=0x628 runnable

"G1 Concurrent Refinement Thread#0" os_prio=2 tid=0x000002b9726df800 nid=0xbd8 runnable

"G1 Concurrent Refinement Thread#1" os_prio=2 tid=0x000002b9726e2800 nid=0x9f0 runnable

"G1 Concurrent Refinement Thread#2" os_prio=2 tid=0x000002b9726df000 nid=0x1128 runnable

"G1 Concurrent Refinement Thread#3" os_prio=2 tid=0x000002b9726d7800 nid=0x1020 runnable

"G1 Concurrent Refinement Thread#4" os_prio=2 tid=0x000002b9726d6000 nid=0x11a0 runnable

"G1 Concurrent Refinement Thread#5" os_prio=2 tid=0x000002b9726d5000 nid=0xb04 runnable

"G1 Concurrent Refinement Thread#6" os_prio=2 tid=0x000002b9726d1000 nid=0x7dc runnable

"G1 Concurrent Refinement Thread#7" os_prio=2 tid=0x000002b9726cd000 nid=0x1308 runnable

"G1 Concurrent Refinement Thread#8" os_prio=2 tid=0x000002b9726cb000 nid=0x8a8 runnable

"VM Periodic Task Thread" os_prio=2 tid=0x000002b97d0ea000 nid=0xa90 waiting on condition

JNI global references: 639

Heap
 garbage-first heap   total 1048576K, used 128157K [0x0000000080000000, 0x0000000080102000, 0x0000000100000000)
  region size 1024K, 112 young (114688K), 23 survivors (23552K)
 Metaspace       used 29838K, capacity 30766K, committed 30848K, reserved 1077248K
  class space    used 3248K, capacity 3455K, committed 3456K, reserved 1048576K
MinnDevelopment commented 3 years ago

First, your issue was not closed, it was simply moved to a discussion where you can continue adding information and get answers.

It seems like the lock is currently held by JDA-NAS and that is why the lock cannot be acquired by the voice server update handler.

"JDA AudioLifeCycle-Worker 1" #51 daemon prio=5 os_prio=0 tid=0x000002b97ea5c800 nid=0xb80 runnable [0x000000dd97cfe000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.destroy(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.freeResources(UdpQueueManager.java:91)
        - locked <0x0000000080264378> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.closeInternal(NativeResourceHolder.java:43)
        - locked <0x0000000080264388> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.close(NativeResourceHolder.java:29)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.shutdownQueueManager(NativeAudioSendFactory.java:51)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.removeInstance(NativeAudioSendFactory.java:79)
        - locked <0x00000000806f5ea0> (a java.lang.Object)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendSystem.shutdown(NativeAudioSendSystem.java:28)
        at net.dv8tion.jda.internal.audio.AudioConnection.shutdown(AudioConnection.java:177)
        - locked <0x00000000802a2828> (a net.dv8tion.jda.internal.audio.AudioConnection)
        at net.dv8tion.jda.internal.audio.AudioConnection.close(AudioConnection.java:169)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$1(AudioManagerImpl.java:133)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$185/1599736865.run(Unknown Source)
        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:146)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.closeAudioConnection(AudioManagerImpl.java:130)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$0(AudioManagerImpl.java:124)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$184/730336045.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Does this issue continue to exist without jda-nas?

nxtByte commented 3 years ago

Honestly, I never had this issue before and I was using the bot as music bot on around 10 different guilds (and used JDA-NAS since the beginning). I am not sure if this is an issue with JDA-NAS. But I will try removing it and then give feedback whether it worked or not. However, the bot used to stream youtube videos as audio into a VC. Since the issue occurs, it is streaming a m3u/mp3 livestream of a german radio station. So basically, since the issue occured I made two changes: adding guild member count and letting the bot play a mp3 24/7

nxtByte commented 3 years ago

Quick side note: It takes a few hours for the exception to occur. So it will take me a couple of hours to give feedback here.

Andre601 commented 3 years ago

I for my part think it's better to switch this to the discussion Minn mentioned:

nxtByte commented 3 years ago

So, quick feedback from me: After removing the JDA-NAS the exception didn't occur any more. However, I would like to use the JDA-NAS again, because I think that the soundsystem is much better in there and there aren't any issues with the garbage collection. Is there any possibility I can include the NAS again without breaking the Discord JDA?

MinnDevelopment commented 3 years ago

@nxtByte is it possible that you are on an outdated version of jda-nas? The line numbers don't seem to match the current source.

nxtByte commented 3 years ago

@MinnDevelopment I should have the latest version. I have version 1.1.0 via JCenter/Bintray Repo from Maven. Looking at github, 1.1.0 is the latest version. I noticed however, that the Maven repo was last changed in 2019 and github's last change was in 2020.

nxtByte commented 3 years ago

I'll try building the version from github myself now and import it back into my project. It will take until tomorrow, until I give feedback, because as said before the issue only occurs after a few hours. Thanks for the help so far!

nxtByte commented 3 years ago

I built the jar with the gradle tools myself now, using the latest version from github. However, the issue occured again today.

Here is the thread dump:

2021-07-02 19:35:07
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.291-b10 mixed mode):

"ForkJoinPool.commonPool-worker-7" #1066 daemon prio=5 os_prio=0 tid=0x0000019012a84800 nid=0x1518 waiting on condition [0x0000006bc27ff000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000804bd400> (a java.util.concurrent.ForkJoinPool)
        at java.util.concurrent.ForkJoinPool.awaitWork(Unknown Source)
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

"JDA Shutdown Hook" #13 prio=5 os_prio=0 tid=0x0000019012a7f000 nid=0x1a2c runnable [0x0000006bc1cfe000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.Throwable.getStackTraceElement(Native Method)
        at java.lang.Throwable.getOurStackTrace(Unknown Source)
        - locked <0x00000000a63057d8> (a java.lang.IllegalStateException)
        at java.lang.Throwable.printStackTrace(Unknown Source)
        - locked <0x00000000805921c8> (a java.io.PrintStream)
        at java.lang.Throwable.printStackTrace(Unknown Source)
        at java.lang.ThreadGroup.uncaughtException(Unknown Source)
        at java.lang.ThreadGroup.uncaughtException(Unknown Source)
        at java.lang.Thread.dispatchUncaughtException(Unknown Source)

"Timer-4" #1063 daemon prio=5 os_prio=0 tid=0x0000019012a80000 nid=0xad4 in Object.wait() [0x0000006bc1afe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.util.TimerThread.mainLoop(Unknown Source)
        - locked <0x00000000a6757328> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Unknown Source)

"Timer-3" #1062 prio=5 os_prio=0 tid=0x0000019012a77000 nid=0x1988 in Object.wait() [0x0000006bc17fe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.util.TimerThread.mainLoop(Unknown Source)
        - locked <0x00000000a6800258> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Unknown Source)

"OkHttp Http2Connection" #1060 daemon prio=5 os_prio=0 tid=0x0000019012a85000 nid=0x1478 waiting on condition [0x0000006bc1bff000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000804bd970> (a java.util.concurrent.SynchronousQueue$TransferStack)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
        at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Okio Watchdog" #1058 daemon prio=5 os_prio=0 tid=0x0000019012a76000 nid=0x1b94 in Object.wait() [0x0000006bc19ff000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at okio.AsyncTimeout.awaitTimeout(AsyncTimeout.java:348)
        at okio.AsyncTimeout$Watchdog.run(AsyncTimeout.java:313)
        - locked <0x0000000080469650> (a java.lang.Class for okio.AsyncTimeout)

"OkHttp ConnectionPool" #1057 daemon prio=5 os_prio=0 tid=0x0000019012a7b800 nid=0x408 waiting on condition [0x0000006bc18fe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000807b1d10> (a java.util.concurrent.SynchronousQueue$TransferStack)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
        at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
        at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA MainWS-WriteThread" #1055 prio=5 os_prio=0 tid=0x0000019012a7a000 nid=0x4c8 in Object.wait() [0x0000006bc22ff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at com.neovisionaries.ws.client.WritingThread.waitForFrames(WritingThread.java:305)
        - locked <0x00000000a73c3c80> (a com.neovisionaries.ws.client.WritingThread)
        at com.neovisionaries.ws.client.WritingThread.main(WritingThread.java:89)
        at com.neovisionaries.ws.client.WritingThread.runMain(WritingThread.java:55)
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

"JDA MainWS-ReadThread" #1054 prio=5 os_prio=0 tid=0x0000019012a78800 nid=0x1774 in Object.wait() [0x0000006bbf2fe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Thread.join(Unknown Source)
        - locked <0x00000000804720c8> (a java.lang.Thread)
        at java.lang.Thread.join(Unknown Source)
        at java.lang.ApplicationShutdownHooks.runHooks(Unknown Source)
        at java.lang.ApplicationShutdownHooks$1.run(Unknown Source)
        at java.lang.Shutdown.runHooks(Unknown Source)
        at java.lang.Shutdown.sequence(Unknown Source)
        at java.lang.Shutdown.exit(Unknown Source)
        - locked <0x000000008050db28> (a java.lang.Class for java.lang.Shutdown)
        at java.lang.Runtime.exit(Unknown Source)
        at java.lang.System.exit(Unknown Source)
        at de.nxtbyte.prionity.commands.management.RebootCommand.action(RebootCommand.java:21)
        at de.nxtbyte.prionity.events.MessageEvent.onGuildMessageReceived(MessageEvent.java:53)
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:398)
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:82)
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:69)
        at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:150)
        at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:97)
        at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
        - locked <0x00000000807942f0> (a net.dv8tion.jda.internal.handle.MessageCreateHandler)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:948)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:835)
        at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:813)
        at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:986)
        at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
        at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
        at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
        at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
        at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

"lava-daemon-pool-playback-1-thread-1" #54 daemon prio=5 os_prio=0 tid=0x0000019012a77800 nid=0x161c waiting on condition [0x0000006bc2dfe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000a6757e80> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.ArrayBlockingQueue.put(Unknown Source)
        at com.sedmelluq.discord.lavaplayer.track.playback.AllocatingAudioFrameBuffer.consume(AllocatingAudioFrameBuffer.java:178)
        at com.sedmelluq.discord.lavaplayer.filter.BufferingPostProcessor.process(BufferingPostProcessor.java:40)
        at com.sedmelluq.discord.lavaplayer.filter.FinalPcmAudioFilter.dispatch(FinalPcmAudioFilter.java:157)
        at com.sedmelluq.discord.lavaplayer.filter.FinalPcmAudioFilter.process(FinalPcmAudioFilter.java:146)
        at com.sedmelluq.discord.lavaplayer.filter.ResamplingPcmAudioFilter.process(ResamplingPcmAudioFilter.java:69)
        at com.sedmelluq.discord.lavaplayer.filter.converter.ToFloatAudioFilter.process(ToFloatAudioFilter.java:65)
        at com.sedmelluq.discord.lavaplayer.filter.AudioPipeline.process(AudioPipeline.java:33)
        at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3TrackProvider.provideFrames(Mp3TrackProvider.java:132)
        at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3AudioTrack$$Lambda$171/23987591.performRead(Unknown Source)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:275)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:249)
        at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3AudioTrack.process(Mp3AudioTrack.java:36)
        at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
        - locked <0x00000000a67570d0> (a com.sedmelluq.discord.lavaplayer.source.http.HttpAudioTrack)
        at com.sedmelluq.discord.lavaplayer.source.http.HttpAudioTrack.process(HttpAudioTrack.java:53)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:104)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$1(DefaultAudioPlayerManager.java:348)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager$$Lambda$167/680596692.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Thread-17" #53 daemon prio=7 os_prio=1 tid=0x0000019012a7e800 nid=0x1aa8 runnable [0x0000006bc2fff000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.process(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.process(UdpQueueManager.java:84)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory$$Lambda$166/1592370921.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-native-udp-1-thread-1" #52 daemon prio=5 os_prio=0 tid=0x0000019012a7c000 nid=0x1bd8 runnable [0x0000006bc2efe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000800ec540> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA AudioLifeCycle-Worker 1" #51 daemon prio=5 os_prio=0 tid=0x0000019012a7d800 nid=0x1718 runnable [0x0000006bc2afe000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.destroy(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.freeResources(UdpQueueManager.java:91)
        - locked <0x00000000800ec380> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.closeInternal(NativeResourceHolder.java:43)
        - locked <0x00000000800ec390> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.close(NativeResourceHolder.java:29)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.shutdownQueueManager(NativeAudioSendFactory.java:51)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.removeInstance(NativeAudioSendFactory.java:79)
        - locked <0x0000000080795288> (a java.lang.Object)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendSystem.shutdown(NativeAudioSendSystem.java:28)
        at net.dv8tion.jda.internal.audio.AudioConnection.shutdown(AudioConnection.java:177)
        - locked <0x00000000801d62f0> (a net.dv8tion.jda.internal.audio.AudioConnection)
        at net.dv8tion.jda.internal.audio.AudioConnection.close(AudioConnection.java:169)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$1(AudioManagerImpl.java:133)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$205/1625937835.run(Unknown Source)
        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:146)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.closeAudioConnection(AudioManagerImpl.java:130)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$0(AudioManagerImpl.java:124)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$204/1912094518.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-info-loader-2-thread-1" #41 daemon prio=5 os_prio=0 tid=0x0000019012a7d000 nid=0xe04 waiting on condition [0x0000006bc29fe000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000000800ec910> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
        at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"lava-daemon-pool-manager-3-thread-1" #38 daemon prio=5 os_prio=0 tid=0x00000190128c3000 nid=0x193c waiting on condition [0x0000006bc26ff000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000008012eb18> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Abandoned connection cleanup thread" #35 daemon prio=5 os_prio=0 tid=0x00000190128c4800 nid=0xe60 in Object.wait() [0x0000006bc1fff000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000809ddb60> (a java.lang.ref.ReferenceQueue$Lock)
        at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:70)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"DestroyJavaVM" #27 prio=5 os_prio=0 tid=0x00000190128c9800 nid=0xe7c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"UC-Loop" #26 prio=5 os_prio=0 tid=0x00000190128c8000 nid=0x46c runnable [0x0000006bc21fe000]
   java.lang.Thread.State: RUNNABLE
        at de.nxtbyte.prionity.utils.UserCountManager.lambda$runLoop$0(UserCountManager.java:28)
        at de.nxtbyte.prionity.utils.UserCountManager$$Lambda$62/1313532469.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Service Thread" #11 daemon prio=9 os_prio=0 tid=0x00000190113d8800 nid=0x1704 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #10 daemon prio=9 os_prio=2 tid=0x0000019011358000 nid=0x830 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #9 daemon prio=9 os_prio=2 tid=0x000001901134f000 nid=0x784 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #8 daemon prio=9 os_prio=2 tid=0x0000019011340800 nid=0xe3c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=2 tid=0x000001901133f800 nid=0x104c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" #6 daemon prio=5 os_prio=2 tid=0x000001901133c800 nid=0x52c runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #5 daemon prio=9 os_prio=2 tid=0x000001901133b800 nid=0xe0 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Surrogate Locker Thread (Concurrent GC)" #4 daemon prio=9 os_prio=0 tid=0x000001901133a800 nid=0x7ec waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x0000019011310800 nid=0x73c in Object.wait() [0x0000006bc0bff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x00000000804c0bc8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x0000019011308000 nid=0x1674 in Object.wait() [0x0000006bc0aff000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Unknown Source)
        at java.lang.ref.Reference.tryHandlePending(Unknown Source)
        - locked <0x00000000804e1bd8> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)

"VM Thread" os_prio=2 tid=0x00000190112e4800 nid=0x5c0 runnable

"Gang worker#0 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a3a800 nid=0x154c runnable

"Gang worker#1 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a3d000 nid=0x1650 runnable

"Gang worker#2 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a3e800 nid=0xac4 runnable

"Gang worker#3 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a42000 nid=0x105c runnable

"Gang worker#4 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a43000 nid=0x6e4 runnable

"Gang worker#5 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a44000 nid=0xeac runnable

"Gang worker#6 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a48800 nid=0x12bc runnable

"Gang worker#7 (Parallel GC Threads)" os_prio=2 tid=0x0000019077a49800 nid=0x12c8 runnable

"G1 Main Concurrent Mark GC Thread" os_prio=2 tid=0x0000019077a86000 nid=0x548 runnable

"Gang worker#0 (G1 Parallel Marking Threads)" os_prio=2 tid=0x000001907efc0800 nid=0x13d0 runnable

"Gang worker#1 (G1 Parallel Marking Threads)" os_prio=2 tid=0x000001907efc1000 nid=0xbd4 runnable

"G1 Concurrent Refinement Thread#0" os_prio=2 tid=0x0000019077a66800 nid=0xf60 runnable

"G1 Concurrent Refinement Thread#1" os_prio=2 tid=0x0000019077a63800 nid=0x1a80 runnable

"G1 Concurrent Refinement Thread#2" os_prio=2 tid=0x0000019077a61800 nid=0x1f4 runnable

"G1 Concurrent Refinement Thread#3" os_prio=2 tid=0x0000019077a60800 nid=0xa0 runnable

"G1 Concurrent Refinement Thread#4" os_prio=2 tid=0x0000019077a5d800 nid=0x5e0 runnable

"G1 Concurrent Refinement Thread#5" os_prio=2 tid=0x0000019077a5c800 nid=0x17d8 runnable

"G1 Concurrent Refinement Thread#6" os_prio=2 tid=0x0000019077a59800 nid=0x13ac runnable

"G1 Concurrent Refinement Thread#7" os_prio=2 tid=0x0000019077a4d800 nid=0x97c runnable

"G1 Concurrent Refinement Thread#8" os_prio=2 tid=0x0000019077a4c800 nid=0x1114 runnable

"VM Periodic Task Thread" os_prio=2 tid=0x00000190113db800 nid=0x15f0 waiting on condition

        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:145)JNI global references: 653

Heap
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.closeAudioConnection(AudioManagerImpl.java:130) garbage-first heap   total 1048576K, used 442847K [0x0000000080000000, 0x0000000080102000, 0x0000000100000000)
  region size 1024K,
419 young (429056K), 4 survivors (4096K)
 Metaspace       used 29883K, capacity 30716K, committed 30848K, reserved 1077248K
  class space    used 3263K, capacity 3456K, committed 3456K, reserved 1048576K

        at net.dv8tion.jda.internal.JDAImpl.lambda$closeAudioConnections$12(JDAImpl.java:753)
        at java.util.ArrayList.forEach(Unknown Source)
        at net.dv8tion.jda.internal.JDAImpl.closeAudioConnections(JDAImpl.java:753)
        at net.dv8tion.jda.internal.JDAImpl.shutdownInternals(JDAImpl.java:712)
        at net.dv8tion.jda.internal.JDAImpl.shutdown(JDAImpl.java:697)
        at java.lang.Thread.run(Unknown Source)
MinnDevelopment commented 3 years ago

There seems to be a potential deadlock in JDA-NAS here

"Thread-44" #98 daemon prio=7 os_prio=1 tid=0x000002b97ea5e000 nid=0x10e0 runnable [0x000000dd97aff000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.process(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.process(UdpQueueManager.java:84)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory$$Lambda$166/622327768.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"JDA AudioLifeCycle-Worker 1" #51 daemon prio=5 os_prio=0 tid=0x0000019012a7d800 nid=0x1718 runnable [0x0000006bc2afe000]
   java.lang.Thread.State: RUNNABLE
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary.destroy(Native Method)
        at com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager.freeResources(UdpQueueManager.java:91)
        - locked <0x00000000800ec380> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManagerLibrary)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.closeInternal(NativeResourceHolder.java:43)
        - locked <0x00000000800ec390> (a com.sedmelluq.discord.lavaplayer.udpqueue.natives.UdpQueueManager)
        at com.sedmelluq.discord.lavaplayer.natives.NativeResourceHolder.close(NativeResourceHolder.java:29)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.shutdownQueueManager(NativeAudioSendFactory.java:51)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendFactory.removeInstance(NativeAudioSendFactory.java:79)
        - locked <0x0000000080795288> (a java.lang.Object)
        at com.sedmelluq.discord.lavaplayer.jdaudp.NativeAudioSendSystem.shutdown(NativeAudioSendSystem.java:28)
        at net.dv8tion.jda.internal.audio.AudioConnection.shutdown(AudioConnection.java:177)
        - locked <0x00000000801d62f0> (a net.dv8tion.jda.internal.audio.AudioConnection)
        at net.dv8tion.jda.internal.audio.AudioConnection.close(AudioConnection.java:169)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$1(AudioManagerImpl.java:133)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$205/1625937835.run(Unknown Source)
        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:146)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.closeAudioConnection(AudioManagerImpl.java:130)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl.lambda$closeAudioConnection$0(AudioManagerImpl.java:124)
        at net.dv8tion.jda.internal.managers.AudioManagerImpl$$Lambda$204/1912094518.run(Unknown Source)
nxtByte commented 3 years ago

I see, is there anything I/you can do about it? As I said I'd really appreciate being able to use the JDA-NAS. I saw that you added the "need more info" label. What can/should I provide you (aside from the thread dump) to sort this issue out?

MinnDevelopment commented 3 years ago

There isn't much we can do here, since the culprit seems to be inside JDA-NAS, which unfortunately I don't know much about myself. The need more info label just marks this issue for further investigation that could help to fix the issue. I don't know what else I can do for you here currently. Try finding a consistent way to reproduce the issue, see what the cause is, and maybe find a way around it. Getting native frames and debug logs could also be helpful.

DV8FromTheWorld commented 2 years ago

There hasn't been any movement on this since Jul and it was stated that the problem is in JDA-NAS. Is there a reason to keep this issue open?

MinnDevelopment commented 2 years ago

This issue might finally be resolved by udpqueue.rs, which reimplements the natives used by jda-nas. Since this implementation is from the ground up, it likely does not have the same deadlock issue.