right_agent 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -286,9 +286,12 @@ module RightScale
286
286
  create_http_client
287
287
  if check_health == :connected
288
288
  enable_use
289
- @stats["reconnects"].update("success")
290
- @reconnect_timer.cancel if @reconnect_timer # only need 'if' for test purposes
291
- @reconnect_timer = @reconnecting = nil
289
+ # Check state again since may have disconnected during enable_use
290
+ if self.state == :connected
291
+ @stats["reconnects"].update("success")
292
+ @reconnect_timer.cancel if @reconnect_timer # only need 'if' for test purposes
293
+ @reconnect_timer = @reconnecting = nil
294
+ end
292
295
  end
293
296
  rescue Exception => e
294
297
  ErrorTracker.log(self, "Failed #{@options[:server_name]} reconnect", e, nil, :caller)
@@ -25,8 +25,8 @@ require 'rbconfig'
25
25
 
26
26
  Gem::Specification.new do |spec|
27
27
  spec.name = 'right_agent'
28
- spec.version = '2.5.0'
29
- spec.date = '2015-02-24'
28
+ spec.version = '2.5.1'
29
+ spec.date = '2015-03-13'
30
30
  spec.authors = ['Lee Kirchhoff', 'Raphael Simon', 'Tony Spataro', 'Scott Messier']
31
31
  spec.email = 'lee@rightscale.com'
32
32
  spec.homepage = 'https://github.com/rightscale/right_agent'
@@ -366,6 +366,13 @@ describe RightScale::BaseRetryClient do
366
366
  @client.send(:reconnect).should be_true
367
367
  end
368
368
 
369
+ it "rechecks state after enables use" do
370
+ flexmock(EM::PeriodicTimer).should_receive(:new).and_return(@timer).and_yield
371
+ flexmock(@client).should_receive(:enable_use).and_return { @client.instance_variable_set(:@state, :disconnected) }.once
372
+ @client.send(:reconnect).should be_true
373
+ @client.instance_variable_get(:@reconnecting).should be true
374
+ end
375
+
369
376
  it "disables timer" do
370
377
  @client.send(:reconnect); @client.instance_variable_set(:@reconnecting, nil) # to get @reconnect_timer initialized
371
378
  @client.instance_variable_set(:@reconnecting, nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-02-24 00:00:00.000000000 Z
15
+ date: 2015-03-13 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: right_support
@@ -415,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
415
  version: '0'
416
416
  segments:
417
417
  - 0
418
- hash: 1759897669862666077
418
+ hash: -2135434958328220214
419
419
  requirements: []
420
420
  rubyforge_project:
421
421
  rubygems_version: 1.8.26