Skip to content

Gracefully close websocket on Errno::EPIPE#162

Closed
johanoskarsson wants to merge 4 commits intoslack-ruby:masterfrom
johanoskarsson:master
Closed

Gracefully close websocket on Errno::EPIPE#162
johanoskarsson wants to merge 4 commits intoslack-ruby:masterfrom
johanoskarsson:master

Conversation

@johanoskarsson
Copy link
Copy Markdown

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.

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Sep 6, 2017

Comment thread CHANGELOG.md Outdated
### 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).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

end

describe '#run_loop with epipe' do
let(:test_socket) do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Sep 18, 2017

Merged via 1a68e2b.

@dblock dblock closed this Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants