splitclient-rb 8.11.1.pre.rc1-java → 8.11.1.pre.rc3-java
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 745e905d4a8d76fb1d0190aab59fff21d911a4d11811e66ca5ffeb42d9612746
|
|
4
|
+
data.tar.gz: a6d392d0c8c0cf82eddd7894735358a3bf9198519c28fe8a1fc4c6b305bbc604
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3fbf4aef5590f7edbb022d9b7498469e89bd117a52661f4b01f4421ba140aac511aa63a463cc7f8c02f9c24d7f1898b9cb3985ba906b45c188e450c26a2d628
|
|
7
|
+
data.tar.gz: b2283bf713d151238189fe59e29faa8c11a956a0009b04e9123d79a3df751c1cefd1a57d6e3e452453f7122e35c92342e68140b251321b9b6c884dc83f2d74c3
|
|
@@ -16,17 +16,21 @@ module SplitIoClient
|
|
|
16
16
|
response = @auth_api_client.authenticate(@api_key)
|
|
17
17
|
@config.logger.debug("Auth service response push_enabled: #{response[:push_enabled]}") if @config.debug_enabled
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
schedule_next_token_refresh(response[:
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
unless response[:push_enabled]
|
|
20
|
+
schedule_next_token_refresh(@back_off.interval) if response[:retry]
|
|
21
|
+
return false
|
|
22
|
+
end
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
unless @sse_handler.start(response[:token], response[:channels])
|
|
25
|
+
@config.logger.debug('Streaming server returned error') if @config.debug_enabled
|
|
26
|
+
stop_sse
|
|
27
|
+
return false
|
|
25
28
|
end
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
schedule_next_token_refresh(response[:exp])
|
|
31
|
+
@back_off.reset
|
|
32
|
+
record_telemetry(response[:exp])
|
|
33
|
+
true
|
|
30
34
|
rescue StandardError => e
|
|
31
35
|
@config.logger.error("start_sse: #{e.inspect}")
|
|
32
36
|
end
|
|
@@ -55,8 +55,8 @@ module SplitIoClient
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def start_periodic_fetch
|
|
58
|
-
@split_fetcher.call
|
|
59
|
-
@segment_fetcher.call
|
|
58
|
+
@split_fetcher.call unless Helpers::ThreadHelper.alive?(:split_fetcher, @config)
|
|
59
|
+
@segment_fetcher.call unless Helpers::ThreadHelper.alive?(:segment_fetcher, @config)
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def stop_periodic_fetch
|
|
@@ -37,17 +37,15 @@ module SplitIoClient
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def close(status = nil)
|
|
40
|
-
|
|
41
|
-
@config.logger.debug('SSEClient already disconected.') if @config.debug_enabled
|
|
42
|
-
return
|
|
43
|
-
end
|
|
44
|
-
@config.logger.debug("Closing SSEClient socket") if @config.debug_enabled
|
|
40
|
+
return if @socket.nil?
|
|
45
41
|
|
|
42
|
+
@config.logger.debug("Closing SSEClient socket") if @config.debug_enabled
|
|
46
43
|
push_status(status)
|
|
47
44
|
@connected.make_false
|
|
48
45
|
@socket.sync_close = true if @socket.is_a? OpenSSL::SSL::SSLSocket
|
|
49
46
|
@socket.close
|
|
50
47
|
@config.logger.debug("SSEClient socket state #{@socket.state}") if @socket.is_a?(OpenSSL::SSL::SSLSocket) && @config.debug_enabled
|
|
48
|
+
@socket = nil
|
|
51
49
|
rescue StandardError => e
|
|
52
50
|
@config.logger.error("SSEClient close Error: #{e.inspect}")
|
|
53
51
|
end
|
|
@@ -80,7 +78,7 @@ module SplitIoClient
|
|
|
80
78
|
@config.threads[:connect_stream] = Thread.new do
|
|
81
79
|
@config.logger.info('Starting connect_stream thread ...')
|
|
82
80
|
new_status = connect_stream(latch)
|
|
83
|
-
push_status(new_status)
|
|
81
|
+
push_status(new_status) unless new_status.nil?
|
|
84
82
|
@config.logger.info('connect_stream thread finished.')
|
|
85
83
|
end
|
|
86
84
|
end
|
|
@@ -92,12 +90,9 @@ module SplitIoClient
|
|
|
92
90
|
if IO.select([@socket], nil, nil, @read_timeout)
|
|
93
91
|
begin
|
|
94
92
|
partial_data = @socket.readpartial(10_000)
|
|
95
|
-
read_first_event(partial_data, latch)
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return Constants::PUSH_RETRYABLE_ERROR
|
|
100
|
-
end
|
|
94
|
+
first_event_status = read_first_event(partial_data, latch)
|
|
95
|
+
return first_event_status unless first_event_status.nil?
|
|
101
96
|
rescue IO::WaitReadable => e
|
|
102
97
|
@config.logger.debug("SSE client IO::WaitReadable transient error: #{e.inspect}") if @config.debug_enabled
|
|
103
98
|
IO.select([@socket], nil, nil, @read_timeout)
|
|
@@ -110,7 +105,7 @@ module SplitIoClient
|
|
|
110
105
|
@config.logger.error("SSE read operation timed out!: #{e.inspect}")
|
|
111
106
|
return Constants::PUSH_RETRYABLE_ERROR
|
|
112
107
|
rescue EOFError => e
|
|
113
|
-
@config.logger.error("SSE read operation EOF
|
|
108
|
+
@config.logger.error("SSE read operation EOF, server closed the connection, will reconnect: #{e.inspect}")
|
|
114
109
|
return Constants::PUSH_RETRYABLE_ERROR
|
|
115
110
|
rescue Errno::EBADF, IOError => e
|
|
116
111
|
@config.logger.error("SSE read operation EBADF or IOError: #{e.inspect}")
|
|
@@ -126,12 +121,9 @@ module SplitIoClient
|
|
|
126
121
|
@config.logger.error("SSE read operation timed out, no data available.")
|
|
127
122
|
return Constants::PUSH_RETRYABLE_ERROR
|
|
128
123
|
end
|
|
129
|
-
rescue Errno::EBADF
|
|
130
|
-
@config.logger.debug("SSE socket is not connected (Errno::EBADF)") if @config.debug_enabled
|
|
131
|
-
break
|
|
132
124
|
rescue Exception => e
|
|
133
125
|
@config.logger.debug("SSE socket is not connected: #{e.inspect}") if @config.debug_enabled
|
|
134
|
-
|
|
126
|
+
return Constants::PUSH_RETRYABLE_ERROR
|
|
135
127
|
end
|
|
136
128
|
|
|
137
129
|
process_data(partial_data)
|
|
@@ -158,19 +150,20 @@ module SplitIoClient
|
|
|
158
150
|
response_code = @event_parser.first_event(data)
|
|
159
151
|
@config.logger.debug("SSE client first event code: #{response_code}") if @config.debug_enabled
|
|
160
152
|
|
|
161
|
-
error_event = false
|
|
162
|
-
events = @event_parser.parse(data)
|
|
163
|
-
events.each { |e| error_event = true if e.event_type == ERROR_EVENT_TYPE }
|
|
164
153
|
@first_event.make_false
|
|
165
154
|
|
|
166
|
-
if response_code
|
|
167
|
-
@
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
push_status(Constants::PUSH_CONNECTED)
|
|
155
|
+
if response_code != OK_CODE
|
|
156
|
+
@config.logger.error("SSE first event failed, code: #{response_code}")
|
|
157
|
+
latch.count_down
|
|
158
|
+
return Constants::PUSH_RETRYABLE_ERROR
|
|
171
159
|
end
|
|
172
160
|
|
|
161
|
+
@connected.make_true
|
|
162
|
+
@config.logger.debug("SSE client first event Connected is true") if @config.debug_enabled
|
|
163
|
+
@telemetry_runtime_producer.record_streaming_event(Telemetry::Domain::Constants::SSE_CONNECTION_ESTABLISHED, nil)
|
|
164
|
+
push_status(Constants::PUSH_CONNECTED)
|
|
173
165
|
latch.count_down
|
|
166
|
+
return nil
|
|
174
167
|
end
|
|
175
168
|
|
|
176
169
|
def socket_connect
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: splitclient-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.11.1.pre.
|
|
4
|
+
version: 8.11.1.pre.rc3
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Split Software
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: allocation_stats
|