slack icon indicating copy to clipboard operation
slack copied to clipboard

socket mode deadman timer ineffective

Open parsley42 opened this issue 2 years ago • 0 comments

What happened

After noticing one of my robots became unresponsive for several minutes, I ran a bot locally and artificially prevented the slack ping from being received using an inbound firewall rule, and found that the connection didn't reset until long after the default 30s timeout.

I triggered a stack dump and found threads blocked on wg.Wait() (as expected) and also receiveMessagesInto / conn.ReadJSON(...). So, it appears the connection isn't reset until both the deadman timer expires AND ReadJSON times out.

Expected behavior

When the deadman timer fires, socket mode should reconnect right away.

Steps to reproduce

  • Establish a socketmode connection
  • Use netstat -ntp to find the port in use
  • Block inbound traffic on the port with e.g. iptable -A INPUT --dport 12345 -j DROP
  • Watch the debug output and wait for the connection to reset

reproducible code

This can be done using just the socket mode example.

manifest.yaml

?

Versions

  • Go:
  • slack-go/slack:

parsley42 avatar Jul 28 '22 15:07 parsley42