-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If Slack client closes, exit the hubot process #215
If Slack client closes, exit the hubot process #215
Conversation
Since Slack client seems to have troubles reconnecting occasionally (e.g. slackapi#203), this seems like the only way to solve it right now. I'm running Hubot using supervisor and in the case of Slack client dropping its connection it seems to me that having the Hubot process exit and get restarted from supervisor is the way to go.
Would this be better as an optional behavior change? |
I'd like to see this merged but I agree with @farski that it should be behind an option. |
@farski @KenPowers Yep, I agree. Would you prefer something like an env var (e.g. |
Either that or if hubot could support
But I think environment variables are more likely. |
Sorry for jumping in like this. |
Set environment variable to e.g. `HUBOT_SLACK_EXIT_ON_DISCONNECT=true` to have the whole Hubot process exit if the Slack client disconnects.
@farski @KenPowers @christopherRiddersater I added a check for an environment variable |
@eriklindebratt Looks reasonable to me. Only thing is |
@farski Ah missed that one, thanks. |
Looks good to me. |
+1 |
+1 This would help my monitoring for sure. My hubot tends to not connect back, so it sits there not doing anything. |
Is this issue pretty much the opposite of #127? |
Seems so, but is configurable on what behavior you want. If you want it to try reconnecting, leave it as is. If you want it to exit so supervisor/script/equivalent can detect it died and spin Hubot back up, go for it and turn the option on. |
The behavior I was observing is that my hubot would never reconnect. |
Same. Mine never tries reconnecting (seemingly), so I'd rather let it exit and respin it back up. |
Same as @KenPowers . The process is up but the last log I see is |
That said, the preferable solution for the long term would be to figure out why hubot isn't reconnecting. |
Agreed. |
Seems reasonable to me |
Yes, I agree about the long term solution and I think that the short time solution may prove useful for other scenarios in the future as well. |
This looks reasonable as a stopgap, thanks all. I will plan to merge and do a patch release with this included later today. |
If Slack client closes, exit the hubot process
Sweet @mjsz, thanks! |
@mjsz Great! Many thanks! |
Any notion of when a new release that includes this will be pushed to NPM? |
Since Slack client seems to have troubles reconnecting occasionally (e.g. #203), this seems like the only way to solve it right now. I'm running Hubot using supervisor and in the case of Slack client dropping its connection it seems to me that having the Hubot process exit and get restarted from e.g. supervisor is the way to go.