Skip to content

Commit ff87c7b

Browse files
authored
Merge pull request #404 from splitio/development
[7.3.3] Development into master
2 parents 23d7f33 + 1a654df commit ff87c7b

25 files changed

Lines changed: 103 additions & 140 deletions

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ AllCops:
6565
- spec/telemetry/synchronizer_spec.rb
6666
- lib/splitclient-rb/engine/synchronizer.rb
6767
- tmp/**/*
68+
- lib/splitclient-rb/sse/event_source/client.rb

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
CHANGES
22

3+
7.3.3 (Jan 28, 2021)
4+
- Fixed edge cases where the sdk lost streaming connection.
5+
- Updated default auth service url to https://auth.split.io/api/v2/auth
6+
- Updated dependencies:
7+
- faraday to >= 0.8, < 2.0
8+
- net-http-persistent to >= 2.9, < 5.0
9+
- redis to >= 4.0.0, < 5.0
10+
- socketry to >= 0.4, < 1.0
11+
- thread_safe to ~> 0.3
12+
313
7.3.2 (Dec 10, 2021)
414
- Updated the readiness flow to be more consistent with the other sdks and improve the readiness time.
515
- Updated the name of telemety key latencies in Redis.

lib/splitclient-rb/cache/fetchers/segment_fetcher.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ def initialize(segments_repository, api_key, config, telemetry_runtime_producer)
1515
def call
1616
if ENV['SPLITCLIENT_ENV'] == 'test'
1717
fetch_segments
18-
else
19-
segments_thread
20-
21-
if defined?(PhusionPassenger)
22-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
23-
segments_thread if forked
24-
end
25-
end
18+
return
2619
end
20+
21+
segments_thread
2722
end
2823

2924
def fetch_segments_if_not_exists(names, cache_control_headers = false)

lib/splitclient-rb/cache/fetchers/split_fetcher.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ def initialize(splits_repository, api_key, config, telemetry_runtime_producer)
1515
def call
1616
if ENV['SPLITCLIENT_ENV'] == 'test'
1717
fetch_splits
18-
else
19-
splits_thread
20-
21-
if defined?(PhusionPassenger)
22-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
23-
splits_thread if forked
24-
end
25-
end
18+
return
2619
end
20+
21+
splits_thread
2722
end
2823

2924
def fetch_splits(fetch_options = { cache_control_headers: false, till: nil })

lib/splitclient-rb/cache/senders/events_sender.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ def initialize(events_repository, config)
1111

1212
def call
1313
events_thread
14-
15-
if defined?(PhusionPassenger)
16-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
17-
events_thread if forked
18-
end
19-
end
2014
end
2115

2216
private

lib/splitclient-rb/cache/senders/impressions_count_sender.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ def initialize(config, impression_counter, impressions_api)
1414

1515
def call
1616
impressions_count_thread
17-
18-
if defined?(PhusionPassenger)
19-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
20-
impressions_count_thread if forked
21-
end
22-
end
2317
end
2418

2519
private

lib/splitclient-rb/cache/senders/impressions_sender.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ def initialize(impressions_repository, config, impressions_api)
1212

1313
def call
1414
impressions_thread
15-
16-
if defined?(PhusionPassenger)
17-
PhusionPassenger.on_event(:starting_worker_process) do |forked|
18-
impressions_thread if forked
19-
end
20-
end
2115
end
2216

2317
private

lib/splitclient-rb/engine/push_manager.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def start_sse
3434
end
3535

3636
def stop_sse
37-
@sse_handler.process_disconnect if @sse_handler.sse_client.nil?
3837
@sse_handler.stop
3938
SplitIoClient::Helpers::ThreadHelper.stop(:schedule_next_token_refresh, @config)
4039
end

lib/splitclient-rb/engine/sync_manager.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ def start_thread
5656
if @config.streaming_enabled
5757
@config.logger.debug('Starting Straming mode ...')
5858
connected = @push_manager.start_sse
59-
60-
if defined?(PhusionPassenger)
61-
PhusionPassenger.on_event(:starting_worker_process) { |forked| sse_thread_forked if forked }
62-
end
6359
end
6460

6561
unless connected
@@ -140,6 +136,7 @@ def process_disconnect(reconnect)
140136
record_telemetry(Telemetry::Domain::Constants::SYNC_MODE, SYNC_MODE_POLLING)
141137

142138
if reconnect
139+
@push_manager.stop_sse
143140
@synchronizer.sync_all
144141
@push_manager.start_sse
145142
end
@@ -150,11 +147,6 @@ def process_disconnect(reconnect)
150147
def record_telemetry(type, data)
151148
@telemetry_runtime_producer.record_streaming_event(type, data)
152149
end
153-
154-
def sse_thread_forked
155-
connected = @push_manager.start_sse
156-
@synchronizer.start_periodic_fetch unless connected
157-
end
158150
end
159151
end
160152
end

lib/splitclient-rb/helpers/thread_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def self.stop(thread_sym, config)
88

99
unless thread.nil?
1010
config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled
11-
sleep(0.1) while thread.status == 'run'
1211
Thread.kill(thread)
1312
end
1413
rescue StandardError => e

0 commit comments

Comments
 (0)