aerospike 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## September 22 2015 (1.0.10)
2
+
3
+ Major fix release.
4
+
5
+ * **Fixes**:
6
+
7
+ * Fixes find_node_in_partition_map logic.
8
+
9
+ * Fixes Node.Refresh logic.
10
+
11
+ * Fixes an issue with dead connections that would cause an infinite loop.
12
+
1
13
  ## Augest 11 2015 (1.0.9)
2
14
 
3
15
  Minor fix release.
@@ -238,7 +238,7 @@ module Aerospike
238
238
  remove_list = find_nodes_to_remove(refresh_count)
239
239
  remove_nodes(remove_list) unless remove_list.empty?
240
240
 
241
- Aerospike.logger.info("Tend finished. Live node count: #{nodes.length}")
241
+ Aerospike.logger.info("Tend finished. Live node count: #{nodes.length} #{nodes}")
242
242
  end
243
243
 
244
244
  def wait_till_stablized
@@ -246,7 +246,6 @@ module Aerospike
246
246
 
247
247
  # will run until the cluster is stablized
248
248
  thr = Thread.new do
249
- abort_on_exception=true
250
249
  while true
251
250
  tend
252
251
 
@@ -445,19 +444,8 @@ module Aerospike
445
444
  def find_node_in_partition_map(filter)
446
445
  partitions_list = partitions
447
446
 
448
- partitions_list.each do |node_array|
449
- max = node_array.length
450
-
451
- i = 0
452
- while i < max
453
- node = node_array[i]
454
- # Use reference equality for performance.
455
- if node == filter
456
- return true
457
- end
458
-
459
- i = i.succ
460
- end
447
+ partitions_list.values.each do |node_array|
448
+ return true if node_array.value.any? { |node| node == filter }
461
449
  end
462
450
  false
463
451
  end
@@ -62,7 +62,7 @@ module Aerospike
62
62
  IO.select(nil, [@socket])
63
63
  retry
64
64
  rescue => e
65
- Aerospike::Exceptions::Connection.new("#{e}")
65
+ raise Aerospike::Exceptions::Connection.new("#{e}")
66
66
  end
67
67
  end
68
68
  end
@@ -72,13 +72,18 @@ module Aerospike
72
72
  while total < length
73
73
  begin
74
74
  bytes = @socket.recv_nonblock(length - total)
75
- buffer.write_binary(bytes, total) if bytes.bytesize > 0
75
+ if bytes.bytesize > 0
76
+ buffer.write_binary(bytes, total)
77
+ else
78
+ # connection is dead; return an error
79
+ raise Aerospike::Exceptions::Aerospike.new(Aerospike::ResultCode::SERVER_NOT_AVAILABLE, "Connection to the server node is dead.")
80
+ end
76
81
  total += bytes.bytesize
77
82
  rescue IO::WaitReadable, Errno::EAGAIN
78
83
  IO.select([@socket], nil)
79
84
  retry
80
85
  rescue => e
81
- Aerospike::Exceptions::Connection.new("#{e}")
86
+ raise Aerospike::Exceptions::Connection.new("#{e}")
82
87
  end
83
88
  end
84
89
  end
@@ -71,17 +71,17 @@ module Aerospike
71
71
  # Request current status from server node, and update node with the result
72
72
  def refresh
73
73
  friends = []
74
- conn = get_connection(1)
75
74
 
76
75
  begin
76
+ conn = get_connection(1)
77
77
  info_map = Info.request(conn, "node", "partition-generation", "services")
78
78
  rescue => e
79
- Aerospike.logger.error(e)
79
+ Aerospike.logger.error("Error during refresh for node #{self}: #{e}")
80
80
 
81
81
  conn.close if conn
82
82
  decrease_health
83
83
 
84
- raise e
84
+ return friends
85
85
  end
86
86
 
87
87
  verify_node_name(info_map)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Aerospike
3
- VERSION = "1.0.9"
3
+ VERSION = "1.0.10"
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: 1.0.9
4
+ version: 1.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-11 00:00:00.000000000 Z
12
+ date: 2015-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack