sensu 0.19.0 → 0.19.1

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: a5ee04199edcbc505d8c7e2ed40c0b54d51e64bb
4
- data.tar.gz: d33375857eedab057e880d5290eeaa4297afcf31
3
+ metadata.gz: 1dc75243d46b5c3d1a4e7637c39fe599af1a0268
4
+ data.tar.gz: bed404c945a267f021355d040bcfec5f87e3fbab
5
5
  SHA512:
6
- metadata.gz: d1a7215833689473b54342e8c50e04e858e191c9b51013acbf4c0568d25ef37f77f892d5dd70db6d9e0976cc2ec1ffaac0e320172261a1b974120d3d80bf5b37
7
- data.tar.gz: b6565070286c64b9c9d5deaf0c253964538a0a8fafaa70e225ce2eb6cc9a9cdbd68522201709d54206625b77617037e67dd8beedacad44439626eccf0a8307cb
6
+ metadata.gz: d1dec9e79a91f97c7e02ee9b942c608b79ff293cca5a7e6191794dda8a29c1786f9e4d254410785056a3b271e581155f8b3926d649002a87c8b6790c41a9674a
7
+ data.tar.gz: 29c9a642beeeb53070890f088aaabb931795b24b6b034f7b015a4d3ea16e303e4433dc9fc363cde273dac2ad137ba7f1b5c84ea34ce7c324755d2a506762eee9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.19.1 - 2015-06-04
2
+
3
+ ### Other
4
+
5
+ Now using an EventMachine timer for the TCP handler connection timeout, as
6
+ `pending_connect_timeout()` and `comm_inactivity_timeout()` are not
7
+ currently supported on all platforms.
8
+
9
+ Updated Thin and UUID tools to the latest versions, which include
10
+ improvements and bug fixes.
11
+
1
12
  ## 0.19.0 - 2015-06-01
2
13
 
3
14
  ### Features
@@ -4,7 +4,7 @@ gem "sinatra", "1.4.6"
4
4
  gem "async_sinatra", "1.2.0"
5
5
 
6
6
  unless RUBY_PLATFORM =~ /java/
7
- gem "thin", "1.5.0"
7
+ gem "thin", "1.6.3"
8
8
  require "thin"
9
9
  end
10
10
 
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.19.0"
4
+ VERSION = "0.19.1"
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown]
data/lib/sensu/daemon.rb CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  gem "multi_json", "1.11.0"
4
4
 
5
- gem "sensu-em", "2.5.0"
5
+ gem "sensu-em", "2.5.1"
6
6
  gem "sensu-logger", "1.0.0"
7
7
  gem "sensu-settings", "1.9.0"
8
8
  gem "sensu-extension", "1.1.2"
@@ -61,8 +61,7 @@ module Sensu
61
61
  end
62
62
  socket.on_error = on_error
63
63
  timeout = handler[:timeout] || 10
64
- socket.pending_connect_timeout = timeout
65
- socket.comm_inactivity_timeout = timeout
64
+ socket.set_timeout(timeout)
66
65
  socket.send_data(event_data.to_s)
67
66
  socket.close_connection_after_writing
68
67
  end
@@ -10,26 +10,38 @@ module Sensu
10
10
  # @return [Proc] callback to be called when there is an error.
11
11
  attr_accessor :on_error
12
12
 
13
- # Record the current time and the inactivity timeout value, when
14
- # the socket connection is successful. These values are used to
15
- # determine if the a connection was closed due to the timeout.
13
+ # Create a timeout timer to immediately close the socket
14
+ # connection and set `@timed_out` to true to indicate that the
15
+ # timeout caused the connection to close. The timeout timer is
16
+ # stored with `@timeout_timer`, so that it can be cancelled when
17
+ # the connection is closed.
18
+ #
19
+ # @param timeout [Numeric] in seconds.
20
+ def set_timeout(timeout)
21
+ @timeout_timer = EM::Timer.new(timeout) do
22
+ @timed_out = true
23
+ close_connection
24
+ end
25
+ end
26
+
27
+ # Record the current time when connected.
16
28
  def connection_completed
17
29
  @connected_at = Time.now.to_f
18
- @inactivity_timeout = comm_inactivity_timeout
19
30
  end
20
31
 
21
32
  # Determine if the connection and data transmission was
22
33
  # successful and call the appropriate callback, `@on_success`
23
- # or `@on_error`, providing it with a message. The
34
+ # or `@on_error`, providing it with a message. Cancel the
35
+ # connection timeout timer `@timeout_timer`, if it is set. The
24
36
  # `@connected_at` timestamp indicates that the connection was
25
- # successful. If the elapsed time is greater than the inactivity
26
- # timeout value, the connection was closed abruptly by the
27
- # timeout timer, and the data was not transmitted.
37
+ # successful. If `@timed_out` is true, the connection was closed
38
+ # by the connection timeout, and the data is assumed to not have
39
+ # been transmitted.
28
40
  def unbind
41
+ @timeout_timer.cancel if @timeout_timer
29
42
  if @connected_at
30
- elapsed_time = Time.now.to_f - @connected_at
31
- if elapsed_time >= @inactivity_timeout
32
- @on_error.call("socket inactivity timeout")
43
+ if @timed_out
44
+ @on_error.call("socket timeout")
33
45
  else
34
46
  @on_success.call("wrote to socket")
35
47
  end
@@ -1,4 +1,4 @@
1
- gem "uuidtools", "2.1.4"
1
+ gem "uuidtools", "2.1.5"
2
2
 
3
3
  require "uuidtools"
4
4
 
data/sensu.gemspec CHANGED
@@ -15,9 +15,9 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency "json" if RUBY_VERSION < "1.9"
17
17
  s.add_dependency "multi_json", "1.11.0"
18
- s.add_dependency "uuidtools", "2.1.4"
18
+ s.add_dependency "uuidtools", "2.1.5"
19
19
  s.add_dependency "eventmachine", "1.0.3"
20
- s.add_dependency "sensu-em", "2.5.0"
20
+ s.add_dependency "sensu-em", "2.5.1"
21
21
  s.add_dependency "sensu-logger", "1.0.0"
22
22
  s.add_dependency "sensu-settings", "1.9.0"
23
23
  s.add_dependency "sensu-extension", "1.1.2"
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_dependency "em-redis-unified", "1.0.0"
28
28
  s.add_dependency "sinatra", "1.4.6"
29
29
  s.add_dependency "async_sinatra", "1.2.0"
30
- s.add_dependency "thin", "1.5.0" unless RUBY_PLATFORM =~ /java/
30
+ s.add_dependency "thin", "1.6.3" unless RUBY_PLATFORM =~ /java/
31
31
 
32
32
  s.add_development_dependency "rake", "~> 10.3"
33
33
  s.add_development_dependency "rspec", "~> 3.0.0"
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.19.0
4
+ version: 0.19.1
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: 2015-06-02 00:00:00.000000000 Z
12
+ date: 2015-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 2.1.4
34
+ version: 2.1.5
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 2.1.4
41
+ version: 2.1.5
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: eventmachine
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 2.5.0
62
+ version: 2.5.1
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 2.5.0
69
+ version: 2.5.1
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: sensu-logger
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -199,14 +199,14 @@ dependencies:
199
199
  requirements:
200
200
  - - '='
201
201
  - !ruby/object:Gem::Version
202
- version: 1.5.0
202
+ version: 1.6.3
203
203
  type: :runtime
204
204
  prerelease: false
205
205
  version_requirements: !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - '='
208
208
  - !ruby/object:Gem::Version
209
- version: 1.5.0
209
+ version: 1.6.3
210
210
  - !ruby/object:Gem::Dependency
211
211
  name: rake
212
212
  requirement: !ruby/object:Gem::Requirement
@@ -307,3 +307,4 @@ signing_key:
307
307
  specification_version: 4
308
308
  summary: A monitoring framework
309
309
  test_files: []
310
+ has_rdoc: false