pinterest / slackminion

A python bot framework for slack
MIT License
22 stars 14 forks source link

Bot fails to reconnect on Slack server migration event #1

Open ruthgrace opened 8 years ago

ruthgrace commented 8 years ago

From docker logs:

2016-08-28 03:43:52,136 Bot WARNING: Slack has initiated a team migration to a new server.  Attempting to reconnect...
2016-08-28 03:43:52,237 requests.packages.urllib3.connectionpool INFO: Starting new HTTPS connection (1): slack.com
2016-08-28 03:43:52,326 requests.packages.urllib3.connectionpool DEBUG: "POST /api/rtm.start HTTP/1.1" 200 64
2016-08-28 03:43:52,329 requests.packages.urllib3.connectionpool INFO: Starting new HTTP connection (1): localhost
2016-08-28 03:43:52,331 Webserver WARNING: Shutdown code received.  Stopping webserver...
2016-08-28 03:43:52,331 werkzeug INFO: 127.0.0.1 - - [28/Aug/2016 03:43:52] "POST /_/shutdown HTTP/1.1" 200 -
2016-08-28 03:43:52,331 requests.packages.urllib3.connectionpool DEBUG: "POST /_/shutdown HTTP/1.1" 200 0

A potential solution is to loop the reconnect and retry every 5 seconds.

balajijegan commented 6 years ago

How often does this happen? Also, is there anything wrong in having this outsourced to the process manager, docker in this case?

arcticfoxnv commented 6 years ago

I have no idea how frequently this occurs, but I would assume anytime Slack does a deploy. As for moving the restart to the process manager - systemd/supervisor/docker/etc - I don't have a problem with that. For an approach, I would suggest making it a config flag to enable/disable restart functionality, so as not to break other bots which might not be expecting the change.