Gracefully close websocket on Errno::EPIPE#162
Closed
johanoskarsson wants to merge 4 commits intoslack-ruby:masterfrom
Closed
Gracefully close websocket on Errno::EPIPE#162johanoskarsson wants to merge 4 commits intoslack-ruby:masterfrom
johanoskarsson wants to merge 4 commits intoslack-ruby:masterfrom
Conversation
Collaborator
|
This looks good. Needs a CHANGELOG entry and a test ala https://github.com/slack-ruby/slack-ruby-client/blob/9ed4d21a5fced74734eb43cf7371509fbf27d388/spec/slack/real_time/concurrency/celluloid_spec.rb, please. |
dblock
reviewed
Sep 7, 2017
| ### 0.9.2 (Next) | ||
|
|
||
| * [#161](https://github.com/slack-ruby/slack-ruby-client/pull/161): Added support for cursor pagination - [@dblock](https://github.com/dblock). | ||
| * [#162](https://github.com/slack-ruby/slack-ruby-client/pull/162): Gracefully close websocket on errno::epipe - [@johanoskarsson](https://github.com/johanoskarsson). |
Collaborator
There was a problem hiding this comment.
Can I be difficult and nitpick? The correct class is Errno::EPIPE, it's case sensitive, so quote it as code and correct upper/lowercase please.
dblock
reviewed
Sep 7, 2017
| end | ||
|
|
||
| describe '#run_loop with epipe' do | ||
| let(:test_socket) do |
Collaborator
There was a problem hiding this comment.
Lets reorganize this a bit? There should be a default test socket for a bunch of tests. Then the fail scenarios should be separate with something like
[Errno::EPIPE, EOFError].each do |ex|
context "when #{ex} is raised" do
...
end
end
Collaborator
|
Merged via 1a68e2b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I kept running into the following error:
E, [2017-09-05T14:23:29.153409 #10948] ERROR -- : Actor crashed!
Errno::EPIPE: Broken pipe
/usr/share/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/openssl/buffering.rb:379:in `syswrite_nonblock'
This would crash my bot entirely. By catching Errno::EPIPE and gracefully closing (and later reconnecting) the error has gone away. I have not done any deeper digging into this issue, but in case others run into it this worked for me.