-
Notifications
You must be signed in to change notification settings - Fork 613
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
Bump slackclient to 1.2.0 with support to reconnect #1184
Conversation
Also, the log is not showing the last version |
CHANGES.rst
Outdated
- Message: Allow partial message size | ||
- Slack: include the option to set Proxy when connecting using SlackClient | ||
- Slack: fix member joined channel event handler | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this was meant to be committed. If you could rebase this out so only the changes to slack.py
and setup.py
remain I'll be happy to merge. 😄
Although, thinking about this a little more... Is letting slackclient handle the reconnection really better than having control over it ourselves? I'm not so sure. In fact, I'd argue errbot handling it itself is better as it notifies plugins that the network went down. This is arguably better than it being handled transparently because otherwise it gives you no way of knowing messages might have been missed/gotten lost. |
@zoni this changes were intentional actually, this file was not updated on the 5.2.0, so I thought that this was something I should have done. :), removed now. |
@zoni about your comment related to the change, at the moment, the connection with Slack just fails, for no reason. so, Errbot will notice after a while that the connection fails and then start a new one. Other option is to set this as an option on the josn |
@zoni any update on this case? Thanks |
I think the compromise here is exposing the setting in the BOT_IDENTITY to allow the user control ovver the functionality. The actual re-connection can be left to the |
@GenPage I agree, the problem is that at the moment, you cannot change any settings on the SlackClient lib, because the connection is started from the Errbot code. |
@zonn @deferato I think I see the concern where zonn is coming from. To help shed some light, the The question becomes, how much of an impact is there on the bot and plugins while we are waiting for the slackclient itself to recover first before raising and allowing the bot to deactivate all the plugins through the disconnect_callback? My thoughts here would be that I woul personally like to have full control over the number of retries and the exponential back off amount before subjecting users to this, or we could just expose it and have it off by default to start. |
@GenPage I agree that is something a bit complex, and may have other impacts on the Bot. |
So I looked at this some more, and based on my current understanding of the issue I remain of the opinion that this is not something we should be doing/exposing. Please correct me if any of the below is incorrect:
I worry adding some kind of "let slackclient itself reconnect" flag just causes confusion to users, especially given the fact errbot already does all this and doesn't need the underlying client to do it for us. Maintaining that control keeps the slack backend more in line with most other backends. @deferato perhaps you can explain how/where errbot's current behavior doesn't meet your expectations/needs? In an earlier comment you said "With this option to auto_reconnect on SlackClient, this will be internal of the client, which will be faster" but I don't see how that could be the case (see point 3 above). |
Hey @zoni, Thanks for taking the time to take another look and provide a detailed explanation. I think point 3 and 4 you made finally made it click in my head. I've reviewed the codebase in more detail and can see that in context of the Slack backend, @deferato I think zoni does have a point, I've compared both ErrBot reconnection in I think its best to keep the reconnection logic in the Base backend class since we have the luxury of informing the plugins of the disruption, no matter which backend you use. [1] https://github.com/errbotio/errbot/blob/master/errbot/backends/base.py#L687 |
@zoni and @GenPage thanks a lot for the comments. Looking deeper the SlackClient code I've noticed that the code is basically a retry connection up to 5 times. Anyway, I believe that we can close this PR without merge it. |
Cool, in that case I will close the issue. Please go ahead and open a separate issue if there are clear issues when connecting via a proxy that we should look at. |
When using slackclient an error is happening that the client is reconnecting after a while.
SlackClient issue
On the slack client page they recommend a change to allow an automatic reconnect.
@gbin