mongo_ha 1.12.1 → 1.12.2

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
  SHA1:
3
- metadata.gz: 24001e509a2bf4c267e910c0086d4600092aeeff
4
- data.tar.gz: 4af9185eaf2cdcad47e53786c4c27776702734c7
3
+ metadata.gz: a318867db1e1e333650522d58e80235f3af0f900
4
+ data.tar.gz: f9333bdd6a54c529c293b5871886c851c0c77d5b
5
5
  SHA512:
6
- metadata.gz: 4eb4feae513d86c118d01b00d0e274a9668d551f83e456ea9abf946d05080800d0fddb1c20faa62dde4aa7d8b012dd845268c5d2aa8c60670aba31a442f6efbb
7
- data.tar.gz: 0cd992c13c58cd09b7f32168c21189ef86456a4bba5546ebbae1530a0879d4954b6a8e9c9315f294b3dd742e59defe346b2bbb80c596f3e65b4b357a4bee1f07
6
+ metadata.gz: be3da7875c5ba4c307685f9ff56eea7e2dd4449906f0fd342a13719dbac8417f803b2f8912d2cd37f5a7fb2a4899594127eb8ae95d1ed057f95f3a252bf405cd
7
+ data.tar.gz: 5b1729d3d085267eeff6fe0144b13d421b00f7f47e4758714bde5d64941c34d51dec862f38c04770c31759ef3847aa0f5168bb9892691601196e172249252caa
@@ -15,7 +15,7 @@ module MongoHA
15
15
  # Operation failed with the following exception: Bad file descriptor - Bad file descriptor:Bad file descriptor - Bad file descriptor
16
16
  # Failed to connect to primary node.
17
17
  # 10009: ReplicaSetMonitor no master found for set: mdbb
18
- MONGOS_CONNECTION_ERRORS = [
18
+ OPERATION_FAILURE_ERRORS = [
19
19
  'socket exception',
20
20
  'Connection reset by peer',
21
21
  'transport error',
@@ -29,6 +29,7 @@ module MongoHA
29
29
  'not master',
30
30
  'Timed out waiting on socket',
31
31
  "didn't get writeback",
32
+ 'interrupted at shutdown'
32
33
  ]
33
34
 
34
35
  module InstanceMethods
@@ -59,7 +60,7 @@ module MongoHA
59
60
  # connection failures
60
61
  @@failover_mutex = Mutex.new
61
62
 
62
- protected
63
+ private
63
64
 
64
65
  def valid_opts(*args)
65
66
  valid_opts_original(*args) + CONNECTION_RETRY_OPTS
@@ -103,6 +104,14 @@ module MongoHA
103
104
  retry
104
105
  end
105
106
  raise exc
107
+ rescue Mongo::AuthenticationError => exc
108
+ # Retry once due to rare failures during authentication against MongoDB V3 servers
109
+ logger.warn "Authentication Failure: '#{exc.message}' [#{exc.error_code}]"
110
+ if !retried && _reconnect
111
+ retried = true
112
+ retry
113
+ end
114
+ raise exc
106
115
  rescue Mongo::OperationFailure => exc
107
116
  # Workaround not master issue. Disconnect connection when we get a not master
108
117
  # error message. Master checks for an exact match on "not master", whereas
@@ -117,7 +126,7 @@ module MongoHA
117
126
  # since it's connections to multiple remote shards may have failed.
118
127
  # Disconnecting the current connection will not help since it is just to the mongos router
119
128
  # First make sure it is connected to the mongos router
120
- raise exc unless (MONGOS_CONNECTION_ERRORS.any? { |err| exc.message.include?(err) }) || (exc.message.strip == ':')
129
+ raise exc unless (OPERATION_FAILURE_ERRORS.any? { |err| exc.message.include?(err) }) || (exc.message.strip == ':')
121
130
 
122
131
  mongos_retries += 1
123
132
  if mongos_retries <= 60
@@ -132,7 +141,7 @@ module MongoHA
132
141
  end
133
142
  end
134
143
 
135
- protected
144
+ private
136
145
 
137
146
  # Call this method whenever a Mongo::ConnectionFailure Exception
138
147
  # has been raised to re-establish the connection
@@ -1,3 +1,3 @@
1
1
  module MongoHA #:nodoc
2
- VERSION = '1.12.1'
2
+ VERSION = '1.12.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_ha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-18 00:00:00.000000000 Z
11
+ date: 2016-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongo
@@ -40,7 +40,7 @@ files:
40
40
  - test/readme.md
41
41
  homepage: https://github.com/reidmorrison/mongo_ha
42
42
  licenses:
43
- - Apache License V2.0
43
+ - Apache-2.0
44
44
  metadata: {}
45
45
  post_install_message:
46
46
  rdoc_options: []
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.4.5.1
61
+ rubygems_version: 2.5.1
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: High availability for the mongo ruby driver