sensu 0.14.0 → 0.15.0.beta

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
  SHA1:
3
- metadata.gz: adea9f9477e945ab2526d28659ef3d236a78f308
4
- data.tar.gz: ed54bd09e178e624a28cad223feee4a1d4d50650
3
+ metadata.gz: 569e92737034cd71fa945830bedb3d7fe66e1905
4
+ data.tar.gz: 504d8ae1f6068aa9cb735e795c4e2eb12d8d6f40
5
5
  SHA512:
6
- metadata.gz: 3f8262a436f850447e9bb3be00974503d8e87c0892def21a7484931db63c88c7d646ba23afdcabe3d27bcb742aad081eb2e15f3522ada6ffcbfcb1e6d4c738bf
7
- data.tar.gz: 85501da63da2b4352a0719893014e960b1c791d87a9939e4b544e176d2c1ad0e832e9b9bb98bb0cb66fc867ab18817a2d0f5f017a45b56bdd36eb0bda05f3b88
6
+ metadata.gz: 2070b2904803138bb6020d31d3044e992319eb76f973ff412f23f31562d862ac185c89ace825e5407bfd2737c0b3d435a07a439e69dd09cd5cc337e5a7e4cee8
7
+ data.tar.gz: 98e1abd0e4e15e2caf86da808c396522cd08be1724e2a9109ee4c4544baf441f59fac6c7354444ac0e6cedb5e3625b4e3ddae3f2e811a0f98d8593d9d9330eb6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.15.0 - TBD
2
+
3
+ ### Features
4
+
5
+ RabbitMQ transport now supports multiple broker connection options,
6
+ enabling connection fail-over to brokers in a cluster without
7
+ using a load balancer.
8
+
1
9
  ## 0.14.0 - 2014-09-29
2
10
 
3
11
  ### Features
data/lib/sensu/client.rb CHANGED
@@ -44,9 +44,7 @@ module Sensu
44
44
  @logger.debug('scheduling keepalives')
45
45
  publish_keepalive
46
46
  @timers[:run] << EM::PeriodicTimer.new(20) do
47
- unless @state == :paused
48
- publish_keepalive
49
- end
47
+ publish_keepalive
50
48
  end
51
49
  end
52
50
 
@@ -195,10 +193,8 @@ module Sensu
195
193
  @timers[:run] << EM::Timer.new(scheduling_delay) do
196
194
  interval = testing? ? 0.5 : check[:interval]
197
195
  @timers[:run] << EM::PeriodicTimer.new(interval) do
198
- unless @state == :paused
199
- check[:issued] = Time.now.to_i
200
- process_check(check.dup)
201
- end
196
+ check[:issued] = Time.now.to_i
197
+ process_check(check.dup)
202
198
  end
203
199
  end
204
200
  end
@@ -247,21 +243,40 @@ module Sensu
247
243
  end
248
244
  end
249
245
 
250
- def start
251
- setup_transport
246
+ def bootstrap
252
247
  setup_keepalives
253
248
  setup_subscriptions
254
249
  setup_standalone
250
+ @state = :running
251
+ end
252
+
253
+ def start
254
+ setup_transport
255
255
  setup_sockets
256
- super
256
+ bootstrap
257
+ end
258
+
259
+ def pause
260
+ super do
261
+ @transport.unsubscribe
262
+ end
263
+ end
264
+
265
+ def resume
266
+ retry_until_true(1) do
267
+ if @state == :paused
268
+ if @transport.connected?
269
+ bootstrap
270
+ true
271
+ end
272
+ end
273
+ end
257
274
  end
258
275
 
259
276
  def stop
260
277
  @logger.warn('stopping')
261
- @timers[:run].each do |timer|
262
- timer.cancel
263
- end
264
- @transport.unsubscribe
278
+ pause
279
+ @state = :stopping
265
280
  complete_checks_in_progress do
266
281
  @transport.close
267
282
  super
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
- VERSION = '0.14.0'
3
+ VERSION = '0.15.0.beta'
4
4
 
5
5
  SEVERITIES = %w[ok warning critical unknown]
6
6
 
data/lib/sensu/daemon.rb CHANGED
@@ -7,7 +7,7 @@ gem 'sensu-logger', '1.0.0'
7
7
  gem 'sensu-settings', '1.2.0'
8
8
  gem 'sensu-extension', '1.0.0'
9
9
  gem 'sensu-extensions', '1.0.0'
10
- gem 'sensu-transport', '1.0.0'
10
+ gem 'sensu-transport', '2.0.0'
11
11
  gem 'sensu-spawn', '1.1.0'
12
12
 
13
13
  require 'time'
@@ -90,8 +90,18 @@ module Sensu
90
90
  @state = :running
91
91
  end
92
92
 
93
- def pause
94
- @state = :paused
93
+ def pause(&block)
94
+ unless @state == :pausing || @state == :paused
95
+ @state = :pausing
96
+ @timers[:run].each do |timer|
97
+ timer.cancel
98
+ end
99
+ @timers[:run].clear
100
+ if block
101
+ block.call
102
+ end
103
+ @state = :paused
104
+ end
95
105
  end
96
106
 
97
107
  def resume
data/lib/sensu/server.rb CHANGED
@@ -727,19 +727,10 @@ module Sensu
727
727
  bootstrap
728
728
  end
729
729
 
730
- def pause(&block)
731
- unless @state == :pausing || @state == :paused
732
- @state = :pausing
733
- @timers[:run].each do |timer|
734
- timer.cancel
735
- end
736
- @timers[:run].clear
730
+ def pause
731
+ super do
737
732
  unsubscribe
738
733
  resign_as_master
739
- @state = :paused
740
- if block
741
- block.call
742
- end
743
734
  end
744
735
  end
745
736
 
@@ -756,13 +747,12 @@ module Sensu
756
747
 
757
748
  def stop
758
749
  @logger.warn('stopping')
759
- pause do
760
- @state = :stopping
761
- complete_handlers_in_progress do
762
- @redis.close
763
- @transport.close
764
- super
765
- end
750
+ pause
751
+ @state = :stopping
752
+ complete_handlers_in_progress do
753
+ @redis.close
754
+ @transport.close
755
+ super
766
756
  end
767
757
  end
768
758
  end
data/sensu.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency('sensu-settings', '1.2.0')
22
22
  s.add_dependency('sensu-extension', '1.0.0')
23
23
  s.add_dependency('sensu-extensions', '1.0.0')
24
- s.add_dependency('sensu-transport', '1.0.0')
24
+ s.add_dependency('sensu-transport', '2.0.0')
25
25
  s.add_dependency('sensu-spawn', '1.1.0')
26
26
  s.add_dependency('em-redis-unified', '0.5.0')
27
27
  s.add_dependency('sinatra', '1.3.5')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-29 00:00:00.000000000 Z
12
+ date: 2014-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 1.0.0
118
+ version: 2.0.0
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: 1.0.0
125
+ version: 2.0.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: sensu-spawn
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -279,9 +279,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
279
279
  version: '0'
280
280
  required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  requirements:
282
- - - ">="
282
+ - - ">"
283
283
  - !ruby/object:Gem::Version
284
- version: '0'
284
+ version: 1.3.1
285
285
  requirements: []
286
286
  rubyforge_project:
287
287
  rubygems_version: 2.2.2