Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

help with server-side disconnects in slack-ruby-client #187

Open
dblock opened this issue Jun 29, 2018 · 6 comments
Open

help with server-side disconnects in slack-ruby-client #187

dblock opened this issue Jun 29, 2018 · 6 comments

Comments

@dblock
Copy link

dblock commented Jun 29, 2018

Coming from slack-ruby/slack-ruby-client#208. The celluloid-io code we have isn't detecting server-side disconnects occasionally. We could really use some professional help, we're likely not using celluloid-io correctly in https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/real_time/concurrency/celluloid.rb#L31

@tarcieri
Copy link
Member

@dblock Celluloid::IO is effectively unmaintained. I would suggest switching to async:

https://github.com/socketry/async

@dblock
Copy link
Author

dblock commented Jun 29, 2018

I opened slack-ruby/slack-ruby-client#210 maybe someone will contribute. Still, celluloid serves us well rn and I'd like to fix the issue as well.

@ioquatix
Copy link
Contributor

Here is (roughly) what we use.

https://gist.github.com/ioquatix/c24f107e2cc7f48e571a37e8e93b0cda?ts=2

@ioquatix
Copy link
Contributor

Sorry, not trying to spam, just trying to help with other suggestions :)

@dblock
Copy link
Author

dblock commented Aug 19, 2018

This is still an ongoing problem, so I could still use some help. What I am seeing is that the run loop still sits inside a read, but that the goes offline.

Debugging messages that are being sent back and forth, next. @tarcieri When you have a second, would you be so kind to share any better logging code that I can add inside the read that would be helpful? Currently I do:

def handle_read(buffer)
  logger.debug("#{self.class}##{__method__}") { buffer }
  driver.parse buffer
end

This produces

D, [2018-08-19T14:27:35.200204 #212] DEBUG -- Slack::RealTime::Concurrency::Celluloid::Socket#handle_read: ?
D, [2018-08-19T14:27:35.200330 #212] DEBUG -- Slack::RealTime::Concurrency::Celluloid::Socket#write: ???6?

Not very useful. I could convert that data to some binary, but that's probably not much better. Maybe there's a parser I should add logging to? Any other recommendations?

I tried setting a global celluloid logger and not seeing anything from celluloid-io.

Celluloid.logger = ...
Celluloid.logger.level = Logger::DEBUG

Thanks.

@dblock
Copy link
Author

dblock commented Aug 19, 2018

Also, is there another driver than https://github.com/faye/websocket-driver-ruby that we should/could be using?

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

No branches or pull requests

3 participants