slack
slack copied to clipboard
socket mode deadman timer ineffective
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: