Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-actioncable-7.0 for 
openSUSE:Factory checked in at 2023-07-03 17:43:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-actioncable-7.0 (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-actioncable-7.0.new.13546 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-actioncable-7.0"

Mon Jul  3 17:43:06 2023 rev:8 rq:1096435 version:7.0.5.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-actioncable-7.0/rubygem-actioncable-7.0.changes
  2023-04-21 18:47:40.480134303 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-actioncable-7.0.new.13546/rubygem-actioncable-7.0.changes
       2023-07-03 17:43:08.980847252 +0200
@@ -1,0 +2,12 @@
+Tue Jun 27 19:30:57 UTC 2023 - Mykola Krachkovsky <w01dn...@gmail.com>
+
+- updated to version 7.0.5.1
+  * 
https://rubyonrails.org/2023/6/26/Rails-Versions-7-0-5-1-6-1-7-4-have-been-released
+
+-------------------------------------------------------------------
+Mon Jun 26 19:05:40 UTC 2023 - Mykola Krachkovsky <w01dn...@gmail.com>
+
+- updated to version 7.0.5
+  * https://rubyonrails.org/2023/5/24/Rails-7-0-5-has-been-released
+
+-------------------------------------------------------------------

Old:
----
  actioncable-7.0.4.3.gem

New:
----
  actioncable-7.0.5.1.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-actioncable-7.0.spec ++++++
--- /var/tmp/diff_new_pack.VFKAZJ/_old  2023-07-03 17:43:09.620851020 +0200
+++ /var/tmp/diff_new_pack.VFKAZJ/_new  2023-07-03 17:43:09.624851044 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-actioncable-7.0
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-actioncable-7.0
-Version:        7.0.4.3
+Version:        7.0.5.1
 Release:        0
 %define mod_name actioncable
 %define mod_full_name %{mod_name}-%{version}

++++++ actioncable-7.0.4.3.gem -> actioncable-7.0.5.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2023-03-13 19:52:54.000000000 +0100
+++ new/CHANGELOG.md    2023-06-26 23:35:18.000000000 +0200
@@ -1,3 +1,15 @@
+## Rails 7.0.5.1 (June 26, 2023) ##
+
+*   No changes.
+
+
+## Rails 7.0.5 (May 24, 2023) ##
+
+*   Restore Action Cable Redis pub/sub listener on connection failure.
+
+    *Vladimir Dementyev*
+
+
 ## Rails 7.0.4.3 (March 13, 2023) ##
 
 *   No changes.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/action_cable/gem_version.rb 
new/lib/action_cable/gem_version.rb
--- old/lib/action_cable/gem_version.rb 2023-03-13 19:52:54.000000000 +0100
+++ new/lib/action_cable/gem_version.rb 2023-06-26 23:35:18.000000000 +0200
@@ -9,8 +9,8 @@
   module VERSION
     MAJOR = 7
     MINOR = 0
-    TINY  = 4
-    PRE   = "3"
+    TINY  = 5
+    PRE   = "1"
 
     STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/action_cable/subscription_adapter/redis.rb 
new/lib/action_cable/subscription_adapter/redis.rb
--- old/lib/action_cable/subscription_adapter/redis.rb  2023-03-13 
19:52:54.000000000 +0100
+++ new/lib/action_cable/subscription_adapter/redis.rb  2023-06-26 
23:35:18.000000000 +0200
@@ -46,7 +46,7 @@
 
       private
         def listener
-          @listener || @server.mutex.synchronize { @listener ||= 
Listener.new(self, @server.event_loop) }
+          @listener || @server.mutex.synchronize { @listener ||= 
Listener.new(self, config_options, @server.event_loop) }
         end
 
         def redis_connection_for_broadcasts
@@ -56,11 +56,15 @@
         end
 
         def redis_connection
-          
self.class.redis_connector.call(@server.config.cable.symbolize_keys.merge(id: 
identifier))
+          self.class.redis_connector.call(config_options)
+        end
+
+        def config_options
+          @config_options ||= @server.config.cable.symbolize_keys.merge(id: 
identifier)
         end
 
         class Listener < SubscriberMap
-          def initialize(adapter, event_loop)
+          def initialize(adapter, config_options, event_loop)
             super()
 
             @adapter = adapter
@@ -69,6 +73,11 @@
             @subscribe_callbacks = Hash.new { |h, k| h[k] = [] }
             @subscription_lock = Mutex.new
 
+            @reconnect_attempt = 0
+            # Use the same config as used by Redis conn
+            @reconnect_attempts = config_options.fetch(:reconnect_attempts, 1)
+            @reconnect_attempts = Array.new(@reconnect_attempts, 0) if 
@reconnect_attempts.is_a?(Integer)
+
             @subscribed_client = nil
 
             @when_connected = []
@@ -84,6 +93,7 @@
                 on.subscribe do |chan, count|
                   @subscription_lock.synchronize do
                     if count == 1
+                      @reconnect_attempt = 0
                       @subscribed_client = original_client
 
                       until @when_connected.empty?
@@ -150,8 +160,16 @@
               @thread ||= Thread.new do
                 Thread.current.abort_on_exception = true
 
-                conn = @adapter.redis_connection_for_subscriptions
-                listen conn
+                begin
+                  conn = @adapter.redis_connection_for_subscriptions
+                  listen conn
+                rescue ConnectionError
+                  reset
+                  if retry_connecting?
+                    when_connected { resubscribe }
+                    retry
+                  end
+                end
               end
             end
 
@@ -163,7 +181,36 @@
               end
             end
 
+            def retry_connecting?
+              @reconnect_attempt += 1
+
+              return false if @reconnect_attempt > @reconnect_attempts.size
+
+              sleep_t = @reconnect_attempts[@reconnect_attempt - 1]
+
+              sleep(sleep_t) if sleep_t > 0
+
+              true
+            end
+
+            def resubscribe
+              channels = @sync.synchronize do
+                @subscribers.keys
+              end
+              @subscribed_client.subscribe(*channels) unless channels.empty?
+            end
+
+            def reset
+              @subscription_lock.synchronize do
+                @subscribed_client = nil
+                @subscribe_callbacks.clear
+                @when_connected.clear
+              end
+            end
+
             if ::Redis::VERSION < "5"
+              ConnectionError = ::Redis::ConnectionError
+
               class SubscribedClient
                 def initialize(raw_client)
                   @raw_client = raw_client
@@ -197,6 +244,8 @@
                 SubscribedClient.new(raw_client)
               end
             else
+              ConnectionError = RedisClient::ConnectionError
+
               def extract_subscribed_client(conn)
                 conn
               end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2023-03-13 19:52:54.000000000 +0100
+++ new/metadata        2023-06-26 23:35:18.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: actioncable
 version: !ruby/object:Gem::Version
-  version: 7.0.4.3
+  version: 7.0.5.1
 platform: ruby
 authors:
 - Pratik Naik
@@ -9,7 +9,7 @@
 autorequire:
 bindir: bin
 cert_chain: []
-date: 2023-03-13 00:00:00.000000000 Z
+date: 2023-06-26 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: activesupport
@@ -17,28 +17,28 @@
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 7.0.4.3
+        version: 7.0.5.1
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 7.0.4.3
+        version: 7.0.5.1
 - !ruby/object:Gem::Dependency
   name: actionpack
   requirement: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 7.0.4.3
+        version: 7.0.5.1
   type: :runtime
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
     requirements:
     - - '='
       - !ruby/object:Gem::Version
-        version: 7.0.4.3
+        version: 7.0.5.1
 - !ruby/object:Gem::Dependency
   name: nio4r
   requirement: !ruby/object:Gem::Requirement
@@ -142,10 +142,10 @@
 - MIT
 metadata:
   bug_tracker_uri: https://github.com/rails/rails/issues
-  changelog_uri: 
https://github.com/rails/rails/blob/v7.0.4.3/actioncable/CHANGELOG.md
-  documentation_uri: https://api.rubyonrails.org/v7.0.4.3/
+  changelog_uri: 
https://github.com/rails/rails/blob/v7.0.5.1/actioncable/CHANGELOG.md
+  documentation_uri: https://api.rubyonrails.org/v7.0.5.1/
   mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
-  source_code_uri: https://github.com/rails/rails/tree/v7.0.4.3/actioncable
+  source_code_uri: https://github.com/rails/rails/tree/v7.0.5.1/actioncable
   rubygems_mfa_required: 'true'
 post_install_message:
 rdoc_options: []
@@ -162,7 +162,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.4.3
+rubygems_version: 3.3.3
 signing_key:
 specification_version: 4
 summary: WebSocket framework for Rails.

Reply via email to