-
Notifications
You must be signed in to change notification settings - Fork 167
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
Catch EBADF when watch_stream fails #280
Conversation
@zeari please add a test for the fix done here |
I have no clue how to test that |
Could you add a test here https://github.com/abonas/kubeclient/blob/master/test/test_watch.rb which stubs the request and raises |
@zeari I thought you said this was preventing your event catcher worker from shutting down and causing it to get hung up? |
I thought so but now i see its just miq taking time shutting down workers. |
Ah okay, still good to catch this cleanly 👍 |
@moolitayer @agrare Added specs |
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.
LGTM
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.
nice trick LGTM 👍
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.
LGTM
Catch EBADF when watch_stream fails
Catch EBADF when watch_stream fails
Catch EBADF when watch_stream fails (cherry picked from commit e33da93)
Catch EBADF when watch_stream fails (cherry picked from commit e33da93)
This issue reared its ugly head again but this time as [----] E, [2018-04-09T14:52:33.790859 #21326:2245430] ERROR -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner#start_event_monitor) EMS [vm-48-38.eng.lab.tlv.redhat.com] as [] Event Monitor Thread aborted because [error reading from socket: Bad file descriptor]
[----] E, [2018-04-09T14:52:33.791242 #21326:2245430] ERROR -- : [HTTP::ConnectionError]: error reading from socket: Bad file descriptor Method:[block in method_missing]
[----] E, [2018-04-09T14:52:33.791371 #21326:2245430] ERROR -- : .../.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/openssl/buffering.rb:125:in `sysread'
.../.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/openssl/buffering.rb:125:in `readpartial'
.../.rvm/gems/ruby-2.3.3/gems/http-2.2.2/lib/http/timeout/null.rb:44:in `readpartial'
.../.rvm/gems/ruby-2.3.3/gems/http-2.2.2/lib/http/connection.rb:212:in `read_more'
.../.rvm/gems/ruby-2.3.3/gems/http-2.2.2/lib/http/connection.rb:87:in `readpartial'
.../.rvm/gems/ruby-2.3.3/gems/http-2.2.2/lib/http/response/body.rb:29:in `readpartial'
.../.rvm/gems/ruby-2.3.3/gems/http-2.2.2/lib/http/response/body.rb:34:in `each'
.../.rvm/gems/ruby-2.3.3/gems/kubeclient-2.5.2/lib/kubeclient/watch_stream.rb:24:in `each'
.../.rvm/gems/ruby-2.3.3/bundler/gems/manageiq-providers-kubernetes-24f1e8999fa7/app/models/manageiq/providers/kubernetes/container_manager/kubernetes_event_monitor.rb:32:in `each'
.../.rvm/gems/ruby-2.3.3/bundler/gems/manageiq-providers-kubernetes-24f1e8999fa7/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb:40:in `monitor_events'
.../Projects/manageiq/app/models/manageiq/providers/base_manager/event_catcher/runner.rb:161:in `block in start_event_monitor' Can we just ignore exceptions when |
Yeah, I think
would be good. |
Solves https://bugzilla.redhat.com/show_bug.cgi?id=1507528
TBH I think we can catch any exception there and not
IOError, EBADF
specifically.Explanation:
until
finish
is called, the code is looping inresponse.body.each do |chunk|
.finish closes
@http_client
while the other thread is reading from it so there could be any exception there depending where exactly the other thread is.This isnt a great solution but the bug is just an error in the log and isnt an actual usability issue
@cben @agrare @moolitayer Please review