DarkAtra
Kord does not recover from UnknownHostException
correct me if i'm wrong but this is how i understand the gateway connection:
There is a websocket connection that kord uses to receive events from discord - for example for command issued by users on a server.
When this websocket connection is closed by the peer for whatever reason, kord attempts to reconnect to the gateway.
Now if the hostname of the gateway could not be resolved - the attempt is aborted and kord never reconnects.
24 replies
Kord does not recover from UnknownHostException
The same issue just happened again today at around 1am. My bot was unable to resolve the hostname
gateway-us-east1-b.discord.gg
for about 2 minutes (using google DNS).
I thought about switching the dns provider that ok-http uses from system
(google dns) to something else. However, this could still fail since there is no guarantee that DNS lookups always succeed. I think the only way of dealing with this issue permantently is to make kord more resilient and attempt reconnects with backoff.
Right now it's getting stuck in a weird state where it can query and update messages in a discord server but doesn't react to application commands anymore.24 replies