sensu 0.28.2 → 0.28.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f8b99b208015d3eb811d1b6e36b3dc7ad274366
4
- data.tar.gz: abe2ba00730d4098e7099df837dede11fa167e0f
3
+ metadata.gz: 9121ba275faec01ad227bfe360ecf35f98bb8136
4
+ data.tar.gz: a9bd2e508a8f271456775a4061ed9ba4e016880c
5
5
  SHA512:
6
- metadata.gz: ad07bc1e414a0a0c393efcd7b8c8cffd1a52db803f71266773a2bd2c09492e780fad3eec3fd746496dc06b44ce414c32848ccc3ac37531b54519bb92472b1a4d
7
- data.tar.gz: 1280b841dae35dedb0f805effc3a489aae8b71f86260a5157964354889c27a973d925349ca0ae7b6753bac4a79bb194e7b67d2988f45f2b745962cdccb26ce79
6
+ metadata.gz: f8493131b507781309e4c769d2e3f9273a1bbe97fc6d5bb82d140b44cd4058ea9edf182ec57c955a0156d3a99cc42ddebfc0089c7e2b20813d9505d062b855f8
7
+ data.tar.gz: a2aa66bc4afe3abcbbe5f378712bd6854784086d5b79865020f85d58a7a652ef4a1c6fe993fe15011eba43e03d8b8af71d90276311aa1043f810b21bfdd1a306
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.28.3 - 2017-03-09
2
+
3
+ ### Fixes
4
+
5
+ The Sensu client now includes check source when tracking in progress check
6
+ executions. These changes are necessary to allow the Sensu client to
7
+ execute on several concurrent proxy check requests.
8
+
1
9
  ## 0.28.2 - 2017-03-03
2
10
 
3
11
  ### Fixes
@@ -100,6 +100,16 @@ module Sensu
100
100
  end
101
101
  end
102
102
 
103
+ # Create an in progress key for a check, used to determine if an
104
+ # execution is still in progress. The key is composed of check
105
+ # `source` (if set) and `name`, joined by a colon.
106
+ #
107
+ # @param check [Hash]
108
+ # @return [String]
109
+ def check_in_progress_key(check)
110
+ [check[:source], check[:name]].compact.join(":")
111
+ end
112
+
103
113
  # Execute a check command, capturing its output (STDOUT/ERR),
104
114
  # exit status code, execution duration, timestamp, and publish
105
115
  # the result. This method guards against multiple executions for
@@ -115,8 +125,9 @@ module Sensu
115
125
  # @param check [Hash]
116
126
  def execute_check_command(check)
117
127
  @logger.debug("attempting to execute check command", :check => check)
118
- unless @checks_in_progress.include?(check[:name])
119
- @checks_in_progress << check[:name]
128
+ in_progress_key = check_in_progress_key(check)
129
+ unless @checks_in_progress.include?(in_progress_key)
130
+ @checks_in_progress << in_progress_key
120
131
  substituted, unmatched_tokens = object_substitute_tokens(check.dup, @settings[:client])
121
132
  check = substituted.merge(:command => check[:command])
122
133
  started = Time.now.to_f
@@ -127,14 +138,14 @@ module Sensu
127
138
  check[:output] = output
128
139
  check[:status] = status
129
140
  publish_check_result(check)
130
- @checks_in_progress.delete(check[:name])
141
+ @checks_in_progress.delete(in_progress_key)
131
142
  end
132
143
  else
133
144
  check[:output] = "Unmatched client token(s): " + unmatched_tokens.join(", ")
134
145
  check[:status] = 3
135
146
  check[:handle] = false
136
147
  publish_check_result(check)
137
- @checks_in_progress.delete(check[:name])
148
+ @checks_in_progress.delete(in_progress_key)
138
149
  end
139
150
  else
140
151
  @logger.warn("previous check command execution in progress", :check => check)
@@ -156,8 +167,9 @@ module Sensu
156
167
  # @param check [Hash]
157
168
  def run_check_extension(check)
158
169
  @logger.debug("attempting to run check extension", :check => check)
159
- unless @checks_in_progress.include?(check[:name])
160
- @checks_in_progress << check[:name]
170
+ in_progress_key = check_in_progress_key(check)
171
+ unless @checks_in_progress.include?(in_progress_key)
172
+ @checks_in_progress << in_progress_key
161
173
  started = Time.now.to_f
162
174
  check[:executed] = started.to_i
163
175
  extension_name = check[:extension] || check[:name]
@@ -167,7 +179,7 @@ module Sensu
167
179
  check[:output] = output
168
180
  check[:status] = status
169
181
  publish_check_result(check)
170
- @checks_in_progress.delete(check[:name])
182
+ @checks_in_progress.delete(in_progress_key)
171
183
  end
172
184
  else
173
185
  @logger.warn("previous check extension execution in progress", :check => check)
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.28.2".freeze
4
+ VERSION = "0.28.3".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.28.2
4
+ version: 0.28.3
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: 2017-03-06 00:00:00.000000000 Z
12
+ date: 2017-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  version: '0'
299
299
  requirements: []
300
300
  rubyforge_project:
301
- rubygems_version: 2.6.6
301
+ rubygems_version: 2.6.3
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: A monitoring framework