Skip to content
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

Bot takes 3 minutes to connect and fails with timeout #185

Open
JayshreeM opened this issue Jun 13, 2017 · 3 comments
Open

Bot takes 3 minutes to connect and fails with timeout #185

JayshreeM opened this issue Jun 13, 2017 · 3 comments
Assignees

Comments

@JayshreeM
Copy link

With simple slack api, using directconnection as follows, slack takes almost 3 minutes to establish initial connection.
SlackSession session = SlackSessionFactory.createWebSocketSlackSession("slack-bot-auth-token");
Is there any performance improvement can be done where it doesnot read all users/channels info at the start.
We have larger team with 4000+ users as of now.

@bcorne bcorne self-assigned this Jun 13, 2017
@kbakhit
Copy link

kbakhit commented Sep 11, 2017

A similar library been also facing this issue: slack-ruby/slack-ruby-client#134. Seems like either timeout needs to be increased to 180+ seconds or try implement rtm.connect instead of rtm.start, not sure..
Any updates on this issue?

@kbakhit
Copy link

kbakhit commented Sep 12, 2017

I figured this out.
The library uses rtm.start API which sends a websocket URL that expires within 30 seconds (https://api.slack.com/methods/rtm.start).
In large teams, SlackJSONSessionStatusParser would be spending a lot of time parsing the users/channels response before returning to allow the websocket URL connection.

A fix would be connecting to the websocket URL ASAP before doing anything else, or implement rtm.connect API instead @bcorne @JayshreeM
Tried it locally, works!

@bcorne
Copy link
Contributor

bcorne commented Nov 8, 2017

Yes, definitely, rtm.connect should be used. I'm looking forward to do that change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants