Skip to content

Commit

Permalink
WIP, cf ManageIQ#275
Browse files Browse the repository at this point in the history
need some way to distinguish "exited intentionally" (.finish/break/return)
from connection closed.
  • Loading branch information
cben committed Feb 12, 2020
1 parent 591b9a3 commit 56dfb9b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/kubeclient/watch_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def each
yield @formatter.call(line.chomp)
end
end
# We get to this point if apiserver closed the socket.
# The connection can also be aborted by network issues / middleboxes,
# which can cause ConnectionError (https://github.com/httprb/http/issues/556).
# The exact cause doesn't matter to caller, bottom line is "infinite" watch finished.
# TODO: attempt resuming (https://github.com/abonas/kubeclient/pull/273).
rescue HTTP::ConnectionError
return
# .finish closing the socket underneath us can cause a wide range of exceptions...
rescue StandardError
raise unless @finished
end
Expand Down

0 comments on commit 56dfb9b

Please sign in to comment.