splitclient-rb 8.10.0.pre.rc3 → 8.10.0.pre.rc5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a02d284b164c23bc6d6d42ff6ac09620e65879978700195e7f7a251fbf1c8f2
4
- data.tar.gz: b2e23d3d62bceacaad46c11db2fd2e5f402c3cbbd3d60625a59eeb1c6a5a1159
3
+ metadata.gz: cd1c96c4c828e35b92aab1832e76f5b3e86b430d1c96063837b44e7149aa1cd8
4
+ data.tar.gz: e35412918b839f46cc7f547f7f1f1ac8f8163ab7d1c47de79a4ed013dc78b5eb
5
5
  SHA512:
6
- metadata.gz: c51285c71b17d907f5f05c8a49c000d77f80e38a367d2288fb63106c4dbe62fc16b7397b84170530302c386164e5209fbb314601a170134a85a243fc40606f36
7
- data.tar.gz: ac1d15560f3f1ab29623dc6052ac6f90fa8a76b44c973d261ef91b93a88c0c81fbfb82117d524b8f99b3084772e8ab07823444475cd752ee9c3ec413664e088c
6
+ metadata.gz: 57c47112c8de1cd38bde1bc462d67ce3f5bb63eb41b6c775fe08591c24e991938c89ed4fd1d48f05008c897dd7af7e79da08578e17a9919db2d547c3b746d6d6
7
+ data.tar.gz: 3541514099aef7a845b89eda8924e307916b7b1f32aff5406054907ac7823f2c9014d0352bb9cc7c6e781d84970de9eeb0a5d8a87afade7ecc8ec7aa8586a824
@@ -86,38 +86,46 @@ module SplitIoClient
86
86
  def connect_stream(latch)
87
87
  return Constants::PUSH_NONRETRYABLE_ERROR unless socket_write(latch)
88
88
  while connected? || @first_event.value
89
- begin
90
- partial_data = ""
91
- Timeout::timeout @read_timeout do
89
+ log_if_debug("Inside coonnect_stream while loop.", 3)
90
+ if IO.select([@socket], nil, nil, @read_timeout)
91
+ begin
92
92
  partial_data = @socket.readpartial(10_000)
93
- end
94
- read_first_event(partial_data, latch)
95
-
96
- raise 'eof exception' if partial_data == :eof
97
- rescue Timeout::Error => e
98
- log_if_debug("SSE read operation timed out!: #{e.inspect}", 3)
99
- return Constants::PUSH_RETRYABLE_ERROR
100
- rescue EOFError => e
101
- log_if_debug("SSE read operation EOF Exception!: #{e.inspect}", 3)
102
- raise 'eof exception'
103
- rescue Errno::EAGAIN => e
104
- log_if_debug("SSE client transient error: #{e.inspect}", 1)
105
- IO.select([tcp_socket])
106
- retry
107
- rescue Errno::EBADF, IOError => e
108
- log_if_debug("SSE read operation EBADF or IOError: #{e.inspect}", 3)
109
- return nil
110
- rescue StandardError => e
111
- log_if_debug("SSE read operation StandardError: #{e.inspect}", 3)
112
- return nil if ENV['SPLITCLIENT_ENV'] == 'test'
93
+ read_first_event(partial_data, latch)
113
94
 
114
- log_if_debug("Error reading partial data: #{e.inspect}", 3)
95
+ raise 'eof exception' if partial_data == :eof
96
+ rescue IO::WaitReadable => e
97
+ log_if_debug("SSE client transient error: #{e.inspect}", 1)
98
+ IO.select([@socket], nil, nil, @read_timeout)
99
+ retry
100
+ rescue Errno::ETIMEDOUT => e
101
+ log_if_debug("SSE read operation timed out!: #{e.inspect}", 3)
102
+ return Constants::PUSH_RETRYABLE_ERROR
103
+ rescue EOFError => e
104
+ log_if_debug("SSE read operation EOF Exception!: #{e.inspect}", 3)
105
+ raise 'eof exception'
106
+ rescue Errno::EAGAIN => e
107
+ log_if_debug("SSE client transient error: #{e.inspect}", 1)
108
+ IO.select([@socket], nil, nil, @read_timeout)
109
+ retry
110
+ rescue Errno::EBADF, IOError => e
111
+ log_if_debug("SSE read operation EBADF or IOError: #{e.inspect}", 3)
112
+ return nil
113
+ rescue StandardError => e
114
+ log_if_debug("SSE read operation StandardError: #{e.inspect}", 3)
115
+ return nil if ENV['SPLITCLIENT_ENV'] == 'test'
116
+
117
+ log_if_debug("Error reading partial data: #{e.inspect}", 3)
118
+ return Constants::PUSH_RETRYABLE_ERROR
119
+ end
120
+ else
121
+ # Timeout occurred, no data available
122
+ log_if_debug("SSE read operation timed out, no data available.", 3)
115
123
  return Constants::PUSH_RETRYABLE_ERROR
116
124
  end
117
125
 
118
126
  process_data(partial_data)
119
127
  end
120
- log_if_debug("SSE read operation exited: #{connected}")
128
+ log_if_debug("SSE read operation exited: #{connected?}", 3)
121
129
 
122
130
  nil
123
131
  end
@@ -146,6 +154,7 @@ module SplitIoClient
146
154
 
147
155
  if response_code == OK_CODE && !error_event
148
156
  @connected.make_true
157
+ @config.logger.debug("SSE client first event Connected is true")
149
158
  @telemetry_runtime_producer.record_streaming_event(Telemetry::Domain::Constants::SSE_CONNECTION_ESTABLISHED, nil)
150
159
  push_status(Constants::PUSH_CONNECTED)
151
160
  end
@@ -183,9 +192,9 @@ module SplitIoClient
183
192
  end
184
193
 
185
194
  def process_data(partial_data)
195
+ log_if_debug("Event partial data: #{partial_data}", 1)
186
196
  return if partial_data.nil? || partial_data == KEEP_ALIVE_RESPONSE
187
197
 
188
- log_if_debug("Event partial data: #{partial_data}", 1)
189
198
  events = @event_parser.parse(partial_data)
190
199
  events.each { |event| process_event(event) }
191
200
  rescue StandardError => e
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '8.10.0-rc3'
2
+ VERSION = '8.10.0-rc5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.10.0.pre.rc3
4
+ version: 8.10.0.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software