Skip to content

Commit 56dfb9b

Browse files
committed
WIP, cf ManageIQ#275
need some way to distinguish "exited intentionally" (.finish/break/return) from connection closed.
1 parent 591b9a3 commit 56dfb9b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/kubeclient/watch_stream.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ def each
2828
yield @formatter.call(line.chomp)
2929
end
3030
end
31+
# We get to this point if apiserver closed the socket.
32+
# The connection can also be aborted by network issues / middleboxes,
33+
# which can cause ConnectionError (https://github.com/httprb/http/issues/556).
34+
# The exact cause doesn't matter to caller, bottom line is "infinite" watch finished.
35+
# TODO: attempt resuming (https://github.com/abonas/kubeclient/pull/273).
36+
rescue HTTP::ConnectionError
37+
return
38+
# .finish closing the socket underneath us can cause a wide range of exceptions...
3139
rescue StandardError
3240
raise unless @finished
3341
end

0 commit comments

Comments
 (0)