From dcdbaecdc98711721a398ffd02d5abaea6ad0780 Mon Sep 17 00:00:00 2001 From: Shlee Date: Wed, 28 Jan 2026 20:44:03 +1030 Subject: [PATCH 1/4] Unclosed connection leak when replacing pooled connection in SharedTimedStack.try_create (#37335) --- app/lib/connection_pool/shared_timed_stack.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/lib/connection_pool/shared_timed_stack.rb b/app/lib/connection_pool/shared_timed_stack.rb index 14a5285c45..f1ace33017 100644 --- a/app/lib/connection_pool/shared_timed_stack.rb +++ b/app/lib/connection_pool/shared_timed_stack.rb @@ -71,6 +71,7 @@ class ConnectionPool::SharedTimedStack throw_away_connection = @queue.pop @tagged_queue[throw_away_connection.site].delete(throw_away_connection) @create_block.call(preferred_tag) + throw_away_connection.close elsif @created != @max connection = @create_block.call(preferred_tag) @created += 1 From 2010bf5f055d4117eddfdc942120bc02bc5b6e28 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 27 Jan 2026 17:01:22 +0100 Subject: [PATCH 2/4] Fix error when encountering invalid tag in updated object (#37635) --- app/services/activitypub/process_status_update_service.rb | 6 +++++- .../activitypub/process_status_update_service_spec.rb | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/services/activitypub/process_status_update_service.rb b/app/services/activitypub/process_status_update_service.rb index 77fcabc536..d5e7e26baa 100644 --- a/app/services/activitypub/process_status_update_service.rb +++ b/app/services/activitypub/process_status_update_service.rb @@ -190,7 +190,11 @@ class ActivityPub::ProcessStatusUpdateService < BaseService def update_tags! previous_tags = @status.tags.to_a - current_tags = @status.tags = Tag.find_or_create_by_names(@raw_tags) + current_tags = @status.tags = @raw_tags.flat_map do |tag| + Tag.find_or_create_by_names([tag]).filter(&:valid?) + rescue ActiveRecord::RecordInvalid + [] + end return unless @status.distributable? diff --git a/spec/services/activitypub/process_status_update_service_spec.rb b/spec/services/activitypub/process_status_update_service_spec.rb index 2c880365ce..c01b48e93b 100644 --- a/spec/services/activitypub/process_status_update_service_spec.rb +++ b/spec/services/activitypub/process_status_update_service_spec.rb @@ -258,6 +258,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do tag: [ { type: 'Hashtag', name: 'foo' }, { type: 'Hashtag', name: 'bar' }, + { type: 'Hashtag', name: '#2024' }, ], } end From f3b47c9436529ae57d986caeb348a89d27b82a5e Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 30 Jan 2026 10:15:22 +0100 Subject: [PATCH 3/4] Clear affected relationship cache on Move activities (#37664) --- app/workers/move_worker.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/workers/move_worker.rb b/app/workers/move_worker.rb index a18f38556b..65c3e38f2e 100644 --- a/app/workers/move_worker.rb +++ b/app/workers/move_worker.rb @@ -64,6 +64,16 @@ class MoveWorker .in_batches do |follows| ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id) num_moved += follows.update_all(target_account_id: @target_account.id) + + # Clear any relationship cache, since callbacks are not called + Rails.cache.delete_multi(follows.flat_map do |follow| + [ + ['relationship', follow.account_id, follow.target_account_id], + ['relationship', follow.target_account_id, follow.account_id], + ['relationship', follow.account_id, @target_account.id], + ['relationship', @target_account.id, follow.account_id], + ] + end) end num_moved From d9bdae0bae1ae0c255a34be7a47cfb1989858037 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 30 Jan 2026 10:59:04 +0100 Subject: [PATCH 4/4] Fix connection recycling pushing symbols to connection pool (#37674) --- app/lib/connection_pool/shared_timed_stack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/connection_pool/shared_timed_stack.rb b/app/lib/connection_pool/shared_timed_stack.rb index f1ace33017..8a13f4473b 100644 --- a/app/lib/connection_pool/shared_timed_stack.rb +++ b/app/lib/connection_pool/shared_timed_stack.rb @@ -70,8 +70,8 @@ class ConnectionPool::SharedTimedStack if @created == @max && !@queue.empty? throw_away_connection = @queue.pop @tagged_queue[throw_away_connection.site].delete(throw_away_connection) - @create_block.call(preferred_tag) throw_away_connection.close + @create_block.call(preferred_tag) elsif @created != @max connection = @create_block.call(preferred_tag) @created += 1