sensu 0.19.0-java → 0.19.1-java

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: af7ed093ded7b2e179a55b77105fb778cac0652e
4
- data.tar.gz: 30adb16516c80250d745845b08f7dd86cb2339f7
3
+ metadata.gz: 9090016c767406f29e1f3580850f4361c5b1f55f
4
+ data.tar.gz: 2c0424c86607bf6a1fccb19c7f493c68dc75937f
5
5
  SHA512:
6
- metadata.gz: 67e3651ad75c33fea8d6e683a552cfa9cdfadedc0a33850d818640f40af4c958020f2878382a0de2063f622d33b5189f60440c47f42051131df68b66edbc6e03
7
- data.tar.gz: 61e889d1eb3767d4ff3b727e24980cf34f2c7ac033352bb3ecbc8aacf55f49cdceba43b11a04ecfab1e31e650f2910cae46a778586eb4c4b471abb1f010b18bd
6
+ metadata.gz: a81971aa8613203a0aec89906bffd3cf301db9c9448326c361b0869afff9762812d6db43c51f282fdb53cc31712d02d63f93b14b5d6d7e1ac2a604927b393c62
7
+ data.tar.gz: 83aec706451de5300dbe3cf979caa2a39140138b59de61f2d1414c3dae577531d60360902d2926da53dfb88114030dcb89394e58f6b232452853a8f6e4451bcc
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: java
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
  requirement: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.4
33
+ version: 2.1.5
34
34
  name: uuidtools
35
35
  prerelease: false
36
36
  type: :runtime
@@ -38,7 +38,7 @@ dependencies:
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
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.5.0
61
+ version: 2.5.1
62
62
  name: sensu-em
63
63
  prerelease: false
64
64
  type: :runtime
@@ -66,7 +66,7 @@ dependencies:
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
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements: