sensu 0.26.3 → 0.26.4

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: a4e499253359ed5c982a0a29ec1c2b05dd76f6c0
4
- data.tar.gz: 5107221e27f4c7bfa7f7233fdefd5bd84b06bd3f
3
+ metadata.gz: 40d2e4826f92172cff091ca9f9748abb7e0da9ad
4
+ data.tar.gz: 41c30523f286c24fcf287f220da4daf087bcf421
5
5
  SHA512:
6
- metadata.gz: 8881c6231598b3c956ae362b3b75eb4851a128a9654338ec5dbbb2b51f2a9ad9200b938cec3f0c2d4992c545c2536dd390c4731e99c872815138e0a46cb775b9
7
- data.tar.gz: d0db425cb038e05a9fb255f34f342bae688d4845205d408144533bf63e6c91bbd170c275b950dd2d489010db10148c11e94d4b25991ce845ffda6355b65196b5
6
+ metadata.gz: c76a81ac584733b7c9b5d4222e219524164c1ee48f717aa2812bc04a5ff3ad54c5d44249e6c9eaa9326ca0020833f55f223f8a504f877e6b44157230d58ee01f
7
+ data.tar.gz: 217707586fc86d2d3a52f46a5c73bba3f0190f31564f9fb65d6ff364dffab8f22c0ea879b7381c5ac19ecad4b9ac14b136d4bd18aeceaa57fd5ee40c6c39348c
@@ -1,3 +1,11 @@
1
+ ## 0.26.4 - 2016-10-05
2
+
3
+ ### Fixes
4
+
5
+ Sensu check extension executions are now properly tracked and the Sensu
6
+ client now guards against multiple concurrent executions of the same
7
+ extension.
8
+
1
9
  ## 0.26.3 - 2016-09-21
2
10
 
3
11
  ### Fixes
@@ -173,20 +173,30 @@ module Sensu
173
173
  # API. If a check definition includes `:extension`, use it's
174
174
  # value for the extension name, otherwise use the check name.
175
175
  # The check definition is passed to the extension `safe_run()`
176
- # method as a parameter, the extension may utilize it.
176
+ # method as a parameter, the extension may utilize it. This
177
+ # method guards against multiple executions for the same check
178
+ # extension.
177
179
  #
178
180
  # https://github.com/sensu/sensu-extension
179
181
  #
180
182
  # @param check [Hash]
181
183
  def run_check_extension(check)
182
184
  @logger.debug("attempting to run check extension", :check => check)
183
- check[:executed] = Time.now.to_i
184
- extension_name = check[:extension] || check[:name]
185
- extension = @extensions[:checks][extension_name]
186
- extension.safe_run(check) do |output, status|
187
- check[:output] = output
188
- check[:status] = status
189
- publish_check_result(check)
185
+ unless @checks_in_progress.include?(check[:name])
186
+ @checks_in_progress << check[:name]
187
+ started = Time.now.to_f
188
+ check[:executed] = started.to_i
189
+ extension_name = check[:extension] || check[:name]
190
+ extension = @extensions[:checks][extension_name]
191
+ extension.safe_run(check) do |output, status|
192
+ check[:duration] = ("%.3f" % (Time.now.to_f - started)).to_f
193
+ check[:output] = output
194
+ check[:status] = status
195
+ publish_check_result(check)
196
+ @checks_in_progress.delete(check[:name])
197
+ end
198
+ else
199
+ @logger.warn("previous check extension execution in progress", :check => check)
190
200
  end
191
201
  end
192
202
 
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.26.3".freeze
4
+ VERSION = "0.26.4".freeze
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown].freeze
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.26.3
4
+ version: 0.26.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-09-22 00:00:00.000000000 Z
12
+ date: 2016-10-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  requirements: []
282
282
  rubyforge_project:
283
- rubygems_version: 2.6.6
283
+ rubygems_version: 2.6.3
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: A monitoring framework