File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
lib/embulk/output/bigquery Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,28 @@ def with_network_retry(&block)
62
62
else
63
63
raise e
64
64
end
65
+
66
+ # httpclient which google-api-ruby-client depends on, catches java.net.SocketException and java.net.ConnectionException and
67
+ # raises SSLError.
68
+ # https://github.com/nahi/httpclient/blob/4658227a46f7caa633ef8036f073bbd1f0a955a2/lib/httpclient/jruby_ssl_socket.rb#L124-L134
69
+ rescue SSLError => e
70
+ retry_messages = [
71
+ "Java::JavaNet::SocketException: Connection reset" ,
72
+ "Java::JavaNet::SocketException: Broken pipe" ,
73
+ "Java::JavaNet::ConnectException: Connection timed out" ,
74
+ ]
75
+ if retry_messages . include? ( e . message )
76
+ if retries < @task [ 'retries' ]
77
+ retries += 1
78
+ Embulk . logger . warn { "embulk-output-bigquery: retry \# #{ retries } , #{ e . class } #{ e . message } " }
79
+ retry
80
+ else
81
+ Embulk . logger . error { "embulk-output-bigquery: retry exhausted \# #{ retries } , #{ e . class } #{ e . message } " }
82
+ raise e
83
+ end
84
+ else
85
+ raise e
86
+ end
65
87
end
66
88
end
67
89
end
You can’t perform that action at this time.
0 commit comments