fix: Deadlock in DiscordShardedClient when Ready is never received (#1761)
* fixed a deadlock in DiscordShardedClient during a failed Identify due to InvalidSession * fixed log * Don't wait ready before releasing semaphore Co-authored-by: Paulo <pnmanjos@hotmail.com>
This commit is contained in:
@@ -245,15 +245,15 @@ namespace Discord.WebSocket
|
||||
await _gatewayLogger.DebugAsync("Identifying").ConfigureAwait(false);
|
||||
await ApiClient.SendIdentifyAsync(shardID: ShardId, totalShards: TotalShards, guildSubscriptions: _guildSubscriptions, gatewayIntents: _gatewayIntents, presence: BuildCurrentStatus()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
//Wait for READY
|
||||
await _connection.WaitAsync().ConfigureAwait(false);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (locked)
|
||||
_shardedClient.ReleaseIdentifyLock();
|
||||
}
|
||||
|
||||
//Wait for READY
|
||||
await _connection.WaitAsync().ConfigureAwait(false);
|
||||
}
|
||||
private async Task OnDisconnectingAsync(Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user