aerospike 2.21.1 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0685f64b5853e918eca12c6ad4a64a1c7ac5c1d0370627c252e598f4686be68
4
- data.tar.gz: a342e374dc180201176018cf1e13c7764a64963fe78e505d55d93b5f2ed83b70
3
+ metadata.gz: 2ad4dc9000e94d5dc8b3c4404e2b68907ba935c196e4061a843f49ec8ad54378
4
+ data.tar.gz: b55b74f657f46946eccd2ea4005075424234c5d12fa5a9bf77416870c2246928
5
5
  SHA512:
6
- metadata.gz: 4151a866e0ff1c36e924aa1a6123411499f7c1bcf48b01177028db5d7a7a72ac2cfde2febb398a42774c4b490c5e0f78839a14a52d5d0c19c9850f5e34dd7141
7
- data.tar.gz: babd62c5d0307153073c51bfa879e0700a9ad56875da37eb711965da82ddc09b765cbbd770ec60c6973d818318200708ba27a4c4ee4a7b598076324ef9093176
6
+ metadata.gz: 37a3fb668569cbe8ff16318847cd99588f7d54afd342f3d45e397bcf2a241d44c7b1f3f5b2cfe6d98978b65d0babf812d6d51bb5051d9cc6a1aef43845e48c65
7
+ data.tar.gz: 3c13ca332594f6edc7cafb4eb68aa996afca8d09436053c31f0faf97b3005f011fa97afeb037aa17bc3a0bc9fcb48cfdad22a20639860dada568433055d47d09
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.22.0] 2022-07-14
6
+
7
+ * **Fixes**
8
+ * [CLIENT-1785] Fix Client#read_users to avoid error. PR #112 Thanks to [Dotan Mor](https://github.com/dotan-mor)
9
+ * [CLIENT-1787] Support multiple DNS IPs during connection.
10
+ * [CLIENT-1789] Authentication Retry fails in certain conditions.
11
+
5
12
  ## [2.21.1] - 2022-06-21
6
13
 
7
14
  This s hotfix release. It is recommended to upgrade your client if you use authentication.
@@ -463,7 +463,7 @@ module Aerospike
463
463
  count = -1
464
464
  done = false
465
465
 
466
- # will run until the cluster is stablized
466
+ # will run until the cluster is stabilized
467
467
  thr = Thread.new do
468
468
  loop do
469
469
  tend
@@ -475,14 +475,17 @@ module Aerospike
475
475
  # Break if timed out
476
476
  break if done
477
477
 
478
- sleep(0.001) # sleep for a milisecond
478
+ sleep(0.001) # sleep for a millisecond
479
479
 
480
480
  count = nodes.length
481
481
  end
482
482
  end
483
483
 
484
484
  # wait for the thread to finish or timeout
485
- thr.join(@connection_timeout)
485
+ # This will give the client up to 10 times the timeout duration to find
486
+ # a host and connect successfully eventually, in case the DNS
487
+ # returns multiple IPs and some of them are not reachable.
488
+ thr.join(@connection_timeout * 10)
486
489
  done = true
487
490
  sleep(0.001)
488
491
  thr.kill if thr.alive?
@@ -381,7 +381,7 @@ module Aerospike
381
381
  raise e
382
382
  end
383
383
 
384
- raise Exceptions::Aerospike.new(result) if status > 0
384
+ raise Exceptions::Aerospike.new(status) if status > 0
385
385
 
386
386
  return list
387
387
  end
@@ -840,12 +840,6 @@ module Aerospike
840
840
  end
841
841
 
842
842
  def size_buffer_sz(size)
843
- # Corrupted data streams can result in a hug.length.
844
- # Do a sanity check here.
845
- if size > Buffer::MAX_BUFFER_SIZE
846
- raise Aerospike::Exceptions::Parse.new("Invalid size for buffer: #{size}")
847
- end
848
-
849
843
  @data_buffer.resize(size)
850
844
  end
851
845
 
@@ -38,6 +38,7 @@ module Aerospike
38
38
  end
39
39
 
40
40
  def authenticate_new(conn, cluster)
41
+ @data_offset = 8
41
42
  policy = cluster.client_policy
42
43
  case policy.auth_mode
43
44
  when Aerospike::AuthMode::EXTERNAL
@@ -125,6 +126,7 @@ module Aerospike
125
126
  end
126
127
 
127
128
  def authenticate_via_token(conn, cluster)
129
+ @data_offset = 8
128
130
  policy = cluster.client_policy
129
131
  if policy.auth_mode != Aerospike::AuthMode::PKI
130
132
  write_header(AUTHENTICATE, 2)
@@ -144,7 +146,7 @@ module Aerospike
144
146
  receive_size = (size & 0xFFFFFFFFFFFF) - HEADER_REMAINING
145
147
  conn.read(@data_buffer, receive_size)
146
148
 
147
- if result != 0
149
+ if result != 0
148
150
  return if result == Aerospike::ResultCode::SECURITY_NOT_ENABLED
149
151
  raise Exceptions::Aerospike.new(result, "Authentication failed")
150
152
  end
@@ -49,7 +49,7 @@ module Aerospike
49
49
  if ae.is_a?(Exceptions::Aerospike)
50
50
  if INVALID_SESSION_ERR.include?(ae.result_code)
51
51
  command.authenticate_new(conn, cluster)
52
- return
52
+ return true
53
53
  end
54
54
  end
55
55
  raise ae
@@ -40,6 +40,7 @@ module Aerospike
40
40
 
41
41
  def get_hosts(address)
42
42
  aliases = [get_alias(address, host.port)]
43
+ res = []
43
44
 
44
45
  begin
45
46
  conn = Cluster::CreateConnection.(@cluster, Host.new(address, host.port, host.tls_name))
@@ -61,11 +62,15 @@ module Aerospike
61
62
  unless is_loopback?(address)
62
63
  aliases = info_map[address_command].split(',').map { |addr| get_alias(*addr.split(':')) }
63
64
  end
65
+
66
+ res = aliases.map { |al| Host.new(al[:address], al[:port], host.tls_name) }
67
+ rescue
68
+ # we don't care about the actual connection error; Just need to continue
64
69
  ensure
65
70
  conn.close if conn
66
71
  end
67
72
 
68
- aliases.map { |al| Host.new(al[:address], al[:port], host.tls_name) }
73
+ res
69
74
  end
70
75
 
71
76
  def get_alias(address, port)
@@ -67,6 +67,12 @@ module Aerospike
67
67
  end
68
68
 
69
69
  def resize(length)
70
+ # Corrupted data streams can result in a hug.length.
71
+ # Do a sanity check here.
72
+ if length > MAX_BUFFER_SIZE
73
+ raise Aerospike::Exceptions::Parse.new("Invalid size for buffer: #{length}")
74
+ end
75
+
70
76
  if @buf.bytesize < length
71
77
  @buf.concat("%0#{length - @buf.bytesize}d" % 0)
72
78
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Aerospike
3
- VERSION = "2.21.1"
3
+ VERSION = "2.22.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aerospike
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.1
4
+ version: 2.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khosrow Afroozeh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-21 00:00:00.000000000 Z
12
+ date: 2022-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack