Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f8e5583

Browse files
authoredNov 4, 2024
RUBY-3571 Add TransientTransactionError label to PoolClearedError (mongodb#2906)
1 parent 1db1244 commit f8e5583

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed
 

‎.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,33 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ ubuntu-20.04 ]
19-
ruby: ["2.7", "3.0", "3.1", "3.2"]
20-
mongodb: ["3.6", "4.4", "5.0", "6.0", "7.0"]
19+
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
20+
mongodb: ["4.4", "5.0", "6.0", "7.0", "8.0"]
2121
topology: [replica_set, sharded_cluster]
2222
include:
2323
- os: macos
2424
ruby: "2.7"
25-
mongodb: "5.0"
25+
mongodb: "7.0"
2626
topology: server
2727
- os: macos
2828
ruby: "3.0"
29-
mongodb: "5.0"
29+
mongodb: "7.0"
3030
topology: server
3131
- os: ubuntu-latest
3232
ruby: "2.7"
33-
mongodb: "5.0"
33+
mongodb: "7.0"
3434
topology: server
3535
- os: ubuntu-latest
3636
ruby: "3.1"
37-
mongodb: "5.0"
37+
mongodb: "7.0"
3838
topology: server
3939
- os: ubuntu-latest
4040
ruby: "3.2"
41-
mongodb: "5.0"
41+
mongodb: "7.0"
4242
topology: server
4343
- os: ubuntu-latest
4444
ruby: "3.2"
45-
mongodb: "6.0"
45+
mongodb: "8.0"
4646
topology: replica_set
4747
steps:
4848
- name: repo checkout

‎lib/mongo/error/pool_cleared_error.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class PoolClearedError < PoolError
3131
#
3232
# @api private
3333
def initialize(address, pool)
34+
add_label('TransientTransactionError')
3435
super(address, pool,
3536
"Connection to #{address} interrupted due to server monitor timeout " +
3637
"(for pool 0x#{pool.object_id})")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
require 'lite_spec_helper'
4+
5+
describe Mongo::Error::PoolClearedError do
6+
describe '#initialize' do
7+
let(:error) do
8+
described_class.new(
9+
instance_double(Mongo::Address), instance_double(Mongo::Server::ConnectionPool)
10+
)
11+
end
12+
13+
it 'appends TransientTransactionError' do
14+
expect(error.labels).to include('TransientTransactionError')
15+
end
16+
end
17+
end

0 commit comments

Comments
 (0)
Please sign in to comment.