right_agent 0.16.2 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -795,8 +795,10 @@ module RightScale
795
795
  true
796
796
  end
797
797
 
798
- # Check status of agent by gathering current operation statistics and publishing them
799
- # and finishing any queue setup
798
+ # Check status of agent by finishing any queue setup, checking the status of the queues,
799
+ # and gathering/publishing current operation statistics
800
+ # Checking the status of a queue will cause the broker connection to fail if the
801
+ # queue does not exist, but a reconnect should then get initiated on the next check loop
800
802
  # Although agent termination cancels the check_status_timer, this method could induce
801
803
  # termination, therefore the termination status needs to be checked before each step
802
804
  #
@@ -810,6 +812,13 @@ module RightScale
810
812
  @exception_stats.track("check status", e)
811
813
  end
812
814
 
815
+ begin
816
+ @broker.queue_status(@queues, timeout = @options[:check_interval] / 10) unless @terminating
817
+ rescue Exception => e
818
+ Log.error("Failed checking queue status", e)
819
+ @exception_stats.track("check status", e)
820
+ end
821
+
813
822
  begin
814
823
  if @stats_routing_key && !@terminating
815
824
  exchange = {:type => :topic, :name => "stats", :options => {:no_declare => true}}
@@ -148,7 +148,7 @@ module RightScale
148
148
  MAX_QUEUE_FLUSH_DELAY = 2 * 60
149
149
 
150
150
  # Maximum number of offline queued requests before triggering restart vote
151
- MAX_QUEUED_REQUESTS = 1000
151
+ MAX_QUEUED_REQUESTS = 100
152
152
 
153
153
  # Number of seconds that should be spent in offline mode before triggering a restart vote
154
154
  RESTART_VOTE_DELAY = 15 * 60
@@ -470,6 +470,8 @@ module RightScale
470
470
  Log.error("Failed to reconnect to broker #{@ping_id}", e, :trace)
471
471
  @exception_stats.track("ping timeout", e)
472
472
  end
473
+ else
474
+ @ping_timer = nil
473
475
  end
474
476
  end
475
477
 
@@ -24,8 +24,8 @@ require 'rubygems'
24
24
 
25
25
  Gem::Specification.new do |spec|
26
26
  spec.name = 'right_agent'
27
- spec.version = '0.16.2'
28
- spec.date = '2013-07-17'
27
+ spec.version = '0.17.0'
28
+ spec.date = '2013-08-04'
29
29
  spec.authors = ['Lee Kirchhoff', 'Raphael Simon', 'Tony Spataro']
30
30
  spec.email = 'lee@rightscale.com'
31
31
  spec.homepage = 'https://github.com/rightscale/right_agent'
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.require_path = 'lib'
39
39
 
40
40
  spec.add_dependency('right_support', ['>= 2.4.1', '< 3.0'])
41
- spec.add_dependency('right_amqp', '~> 0.4')
41
+ spec.add_dependency('right_amqp', '~> 0.7')
42
42
  spec.add_dependency('json', ['>= 1.4', '<= 1.7.6']) # json_create behavior change in 1.7.7
43
43
  spec.add_dependency('eventmachine', ['>= 0.12.10', '< 2.0'])
44
44
  spec.add_dependency('msgpack', ['>= 0.4.4', '< 0.6'])
@@ -304,6 +304,7 @@ describe RightScale::Agent do
304
304
  run_in_em do
305
305
  @broker.should_receive(:subscribe).with(hsh(:name => @identity), nil, hsh(:brokers => nil), Proc).
306
306
  and_return(@broker_ids.first(1)).once
307
+ @broker.should_receive(:queue_status).with([@identity], 30).once
307
308
  @agent.run
308
309
  @agent.instance_variable_get(:@remaining_queue_setup).should == {@identity => @broker_ids.last(1)}
309
310
  @sender.should_receive(:send_push).with("/registrar/connect", {:agent_identity => @identity, :host => "123",
@@ -140,12 +140,14 @@ describe RightScale::Sender do
140
140
  EM.run do
141
141
  EM.add_timer(1) { EM.stop }
142
142
  RightScale::Sender.new(@agent)
143
- instance = RightScale::Sender.instance
144
- flexmock(instance).should_receive(:publish).and_return([]).once
145
- instance.connectivity_checker.check(id = nil)
143
+ @instance = RightScale::Sender.instance
144
+ flexmock(@instance).should_receive(:publish).and_return([]).once
145
+ @instance.connectivity_checker.check(id = nil)
146
146
  end
147
147
  ensure
148
148
  RightScale::Sender::ConnectivityChecker.const_set(:PING_TIMEOUT, old_ping_timeout)
149
+ @instance.connectivity_checker.instance_variable_get(:@ping_timer).should be_nil
150
+ @instance.connectivity_checker.instance_variable_get(:@ping_id).should be_nil
149
151
  end
150
152
  end
151
153
 
metadata CHANGED
@@ -1,164 +1,118 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: right_agent
3
- version: !ruby/object:Gem::Version
4
- hash: 91
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 16
9
- - 2
10
- version: 0.16.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.17.0
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Lee Kirchhoff
14
9
  - Raphael Simon
15
10
  - Tony Spataro
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2013-07-17 00:00:00 -07:00
21
- default_executable:
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
24
- version_requirements: &id001 !ruby/object:Gem::Requirement
14
+ date: 2013-08-04 00:00:00.000000000Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: right_support
18
+ requirement: &2168887200 !ruby/object:Gem::Requirement
25
19
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 29
30
- segments:
31
- - 2
32
- - 4
33
- - 1
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
34
23
  version: 2.4.1
35
24
  - - <
36
- - !ruby/object:Gem::Version
37
- hash: 7
38
- segments:
39
- - 3
40
- - 0
41
- version: "3.0"
42
- requirement: *id001
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
43
27
  type: :runtime
44
- name: right_support
45
28
  prerelease: false
46
- - !ruby/object:Gem::Dependency
47
- version_requirements: &id002 !ruby/object:Gem::Requirement
29
+ version_requirements: *2168887200
30
+ - !ruby/object:Gem::Dependency
31
+ name: right_amqp
32
+ requirement: &2168885180 !ruby/object:Gem::Requirement
48
33
  none: false
49
- requirements:
34
+ requirements:
50
35
  - - ~>
51
- - !ruby/object:Gem::Version
52
- hash: 3
53
- segments:
54
- - 0
55
- - 4
56
- version: "0.4"
57
- requirement: *id002
36
+ - !ruby/object:Gem::Version
37
+ version: '0.7'
58
38
  type: :runtime
59
- name: right_amqp
60
39
  prerelease: false
61
- - !ruby/object:Gem::Dependency
62
- version_requirements: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: *2168885180
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: &2168883820 !ruby/object:Gem::Requirement
63
44
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- hash: 7
68
- segments:
69
- - 1
70
- - 4
71
- version: "1.4"
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '1.4'
72
49
  - - <=
73
- - !ruby/object:Gem::Version
74
- hash: 7
75
- segments:
76
- - 1
77
- - 7
78
- - 6
50
+ - !ruby/object:Gem::Version
79
51
  version: 1.7.6
80
- requirement: *id003
81
52
  type: :runtime
82
- name: json
83
53
  prerelease: false
84
- - !ruby/object:Gem::Dependency
85
- version_requirements: &id004 !ruby/object:Gem::Requirement
54
+ version_requirements: *2168883820
55
+ - !ruby/object:Gem::Dependency
56
+ name: eventmachine
57
+ requirement: &2168882040 !ruby/object:Gem::Requirement
86
58
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 59
91
- segments:
92
- - 0
93
- - 12
94
- - 10
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
95
62
  version: 0.12.10
96
63
  - - <
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 2
101
- - 0
102
- version: "2.0"
103
- requirement: *id004
64
+ - !ruby/object:Gem::Version
65
+ version: '2.0'
104
66
  type: :runtime
105
- name: eventmachine
106
67
  prerelease: false
107
- - !ruby/object:Gem::Dependency
108
- version_requirements: &id005 !ruby/object:Gem::Requirement
68
+ version_requirements: *2168882040
69
+ - !ruby/object:Gem::Dependency
70
+ name: msgpack
71
+ requirement: &2168880380 !ruby/object:Gem::Requirement
109
72
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- hash: 7
114
- segments:
115
- - 0
116
- - 4
117
- - 4
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
118
76
  version: 0.4.4
119
77
  - - <
120
- - !ruby/object:Gem::Version
121
- hash: 7
122
- segments:
123
- - 0
124
- - 6
125
- version: "0.6"
126
- requirement: *id005
78
+ - !ruby/object:Gem::Version
79
+ version: '0.6'
127
80
  type: :runtime
128
- name: msgpack
129
81
  prerelease: false
130
- - !ruby/object:Gem::Dependency
131
- version_requirements: &id006 !ruby/object:Gem::Requirement
82
+ version_requirements: *2168880380
83
+ - !ruby/object:Gem::Dependency
84
+ name: net-ssh
85
+ requirement: &2168878400 !ruby/object:Gem::Requirement
132
86
  none: false
133
- requirements:
87
+ requirements:
134
88
  - - ~>
135
- - !ruby/object:Gem::Version
136
- hash: 3
137
- segments:
138
- - 2
139
- - 0
140
- version: "2.0"
141
- requirement: *id006
89
+ - !ruby/object:Gem::Version
90
+ version: '2.0'
142
91
  type: :runtime
143
- name: net-ssh
144
92
  prerelease: false
145
- description: |
146
- RightAgent provides a foundation for running an agent on a server to interface
93
+ version_requirements: *2168878400
94
+ description: ! 'RightAgent provides a foundation for running an agent on a server
95
+ to interface
96
+
147
97
  in a secure fashion with other agents in the RightScale system. A RightAgent
98
+
148
99
  uses RabbitMQ as the message bus and the RightScale mapper as the routing node.
100
+
149
101
  Servers running a RightAgent establish a queue on startup for receiving packets
102
+
150
103
  routed to it via the mapper. The packets are structured to invoke services in
104
+
151
105
  the agent represented by actors and methods. The RightAgent may respond to these
106
+
152
107
  requests with a result packet that the mapper then routes to the originator.
153
108
 
109
+ '
154
110
  email: lee@rightscale.com
155
111
  executables: []
156
-
157
112
  extensions: []
158
-
159
- extra_rdoc_files:
113
+ extra_rdoc_files:
160
114
  - README.rdoc
161
- files:
115
+ files:
162
116
  - LICENSE
163
117
  - README.rdoc
164
118
  - Rakefile
@@ -311,44 +265,35 @@ files:
311
265
  - spec/spec.win32.opts
312
266
  - spec/spec_helper.rb
313
267
  - spec/tracer_spec.rb
314
- has_rdoc: true
315
268
  homepage: https://github.com/rightscale/right_agent
316
269
  licenses: []
317
-
318
270
  post_install_message:
319
- rdoc_options:
271
+ rdoc_options:
320
272
  - --main
321
273
  - README.rdoc
322
274
  - --title
323
275
  - RightAgent
324
- require_paths:
276
+ require_paths:
325
277
  - lib
326
- required_ruby_version: !ruby/object:Gem::Requirement
278
+ required_ruby_version: !ruby/object:Gem::Requirement
327
279
  none: false
328
- requirements:
329
- - - ">="
330
- - !ruby/object:Gem::Version
331
- hash: 57
332
- segments:
333
- - 1
334
- - 8
335
- - 7
280
+ requirements:
281
+ - - ! '>='
282
+ - !ruby/object:Gem::Version
336
283
  version: 1.8.7
337
- required_rubygems_version: !ruby/object:Gem::Requirement
284
+ required_rubygems_version: !ruby/object:Gem::Requirement
338
285
  none: false
339
- requirements:
340
- - - ">="
341
- - !ruby/object:Gem::Version
342
- hash: 3
343
- segments:
286
+ requirements:
287
+ - - ! '>='
288
+ - !ruby/object:Gem::Version
289
+ version: '0'
290
+ segments:
344
291
  - 0
345
- version: "0"
292
+ hash: 4577991098158607352
346
293
  requirements: []
347
-
348
294
  rubyforge_project:
349
- rubygems_version: 1.3.7
295
+ rubygems_version: 1.8.10
350
296
  signing_key:
351
297
  specification_version: 3
352
298
  summary: Agent for interfacing server with RightScale system
353
299
  test_files: []
354
-