Skip to content

Commit

Permalink
Fix deadlock on requester shutdown during login
Browse files Browse the repository at this point in the history
  • Loading branch information
MinnDevelopment committed Apr 30, 2022
1 parent 89a6cdd commit b07837f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/dv8tion/jda/internal/JDAImpl.java
Expand Up @@ -758,8 +758,7 @@ public synchronized void shutdownInternals()
guildSetupController.close();

// stop accepting new requests
if (requester.stop()) // returns true if no more requests will be executed
shutdownRequester(); // in that case shutdown entirely
requester.stop(); // the requester calls shutdownRequester when its done
threadConfig.shutdown();

if (shutdownHook != null)
Expand All @@ -774,7 +773,7 @@ public synchronized void shutdownInternals()
setStatus(Status.SHUTDOWN);
}

public synchronized void shutdownRequester()
public void shutdownRequester()
{
// Stop all request processing
requester.shutdown();
Expand Down

0 comments on commit b07837f

Please sign in to comment.