-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException: Could not acquire lock in reasonable timeframe #1700
Comments
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? |
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. |
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. |
I for my part think it's better to switch this to the discussion Minn mentioned: |
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? |
@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. |
@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. |
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! |
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:
|
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) |
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? |
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. |
There hasn't been any movement on this since Jul and it was stated that the problem is in JDA-NAS. |
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. |
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:
Thread Dump:
The text was updated successfully, but these errors were encountered: