trident 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWVkOTkzYzA0Y2Y4NGJjODIzZWI2ZjJmNzExOWQ3YWUyN2I3ZDQ2OA==
4
+ YzQ4Zjg1MWU4YjFiMjc2Y2JiZWI0OGJkYzVlODk1NWJlOTdmNmMzNw==
5
5
  data.tar.gz: !binary |-
6
- YThjMjE1Y2Q4MWM1YWRiMDI4ZWU1N2ViNzMzNjg2NWNmM2FiMjdhZA==
6
+ NmQwNjFjMmQ4MzM3MGFhMDM3ZDc3ZmJkMjc5MDhjNzAzZjdlNTYxNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWNjOTRiYWE4YTUxMmI0ZWQ0MWZhOWEyMjc0ZWM5YTgzMGYxMmRjYTM3ODI3
10
- MDU4ZWZiMDY0Mzc5ZTRlMTk0ZTBiN2MwZDI0YThhZjY5MjgwZDJkMGMxNDU5
11
- ZTU0NDlmMDVkMzc1OGEwOTFmMjFlMDMxZDBmODk1NWI5OTJhMTc=
9
+ ZDE0ZmY2MGE1ZWY5NjRiODk4ZTc3M2U0MDRmMWU5NzljNGVkNDFlNGNkMzJj
10
+ NWY4N2QxN2E2ODI0ODAzZGQzMDdhZTFjZmJjYmY3YTE5NjRjN2E1OWMyMzRi
11
+ OTUzOThmMTliMmJjM2U0M2FiZWU4MTkxNTM2MzJhNTU0ODE1OWI=
12
12
  data.tar.gz: !binary |-
13
- M2E4NTFmOTc2OWFlNzg2YWZmMGY4YmViODExNGQyYmEwODNlMzY2MjgyNjlh
14
- ODI5Y2IyZmIzNTg0M2ZkMzQyOWE4NjZkN2UwMjY2NWNjMmE2MzZlZDI0NjRm
15
- MDc1NmYzOGYxNTU1MGIzYzJlY2MwNmVhYWZlNzBkM2NiZTliNjM=
13
+ MDk2YWZmYWFlNzMxZjQxOTk4YmMyNjIyMzQ5ZWVlYThiMjRiMWRkZDJkYmNh
14
+ MzljZjU0NDliNmQ1ZTYyMjA0ZDZiOGFhMTdkMmU3NDgzYWRjNWZmNTExNjM1
15
+ NjlmODkyNzUxMjhiMDU0NWM5ZDg4OGUyNjEwZTUwYmZjN2ZlZmI=
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 0.4.1 (11/20/2013)
2
+ ------------------
3
+
4
+ fix race condition between start and update at startup time <2c5d4ee> [Matt Conway]
5
+
1
6
  0.4.0 (11/19/2013)
2
7
  ------------------
3
8
 
data/lib/trident/cli.rb CHANGED
@@ -70,7 +70,6 @@ module Trident
70
70
  pools.values,
71
71
  config_hash['prefork'] == true)
72
72
  Trident::SignalHandler.start(config_hash['signals'], manager)
73
- manager.start
74
73
  Trident::SignalHandler.join
75
74
  end
76
75
 
@@ -54,11 +54,13 @@ module Trident
54
54
  def start
55
55
  setup_self_pipe
56
56
  setup_signal_handlers
57
+ target.start if target.respond_to?(:start)
57
58
 
58
59
  @main_loop = Thread.new do
59
60
  logger.info "Main loop started"
60
61
  loop do
61
62
  signal_result = handle_signal_queue
63
+ target.update if target.respond_to?(:update)
62
64
  break if signal_result == :break
63
65
  logger.debug "Snoozing main loop"
64
66
  msg = snooze if signal_queue.empty?
@@ -1,3 +1,3 @@
1
1
  module Trident
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -93,8 +93,8 @@ class FileCounter
93
93
 
94
94
  end
95
95
 
96
- def wait_for(io, pattern)
97
- timeout(5) do
96
+ def wait_for(io, pattern, interval=5)
97
+ timeout(interval) do
98
98
  loop do
99
99
  line = io.readline
100
100
  puts line if ENV['DEBUG']
@@ -19,24 +19,6 @@ class Trident::SignalHandlerTest < MiniTest::Should::TestCase
19
19
  end
20
20
  end
21
21
 
22
- def do_in_child
23
- read_from_child, write_from_child = IO.pipe
24
-
25
- pid = fork do
26
- read_from_child.close
27
- result = yield
28
- Marshal.dump(result, write_from_child)
29
- exit!(0) # skips exit handlers.
30
- end
31
-
32
- [pid, read_from_child]
33
- write_from_child.close
34
- result = read_from_child.read
35
- Process.wait(pid)
36
- raise "child failed" if result.empty?
37
- Marshal.load(result)
38
- end
39
-
40
22
  context "#signal_mappings==" do
41
23
 
42
24
  should "normalize signal names" do
@@ -257,7 +239,9 @@ class Trident::SignalHandlerTest < MiniTest::Should::TestCase
257
239
  Process.kill("USR1", fc.pid)
258
240
 
259
241
  received = fc.wait
260
- assert_equal [[:bar, [], nil], [:foo, [], nil], [:action_break, [], nil]], received
242
+ assert_includes received, [:bar, [], nil]
243
+ assert_includes received, [:foo, [], nil]
244
+ assert_includes received, [:action_break, [], nil]
261
245
  end
262
246
 
263
247
  should "preserve SIGCHLD behavior" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trident
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_logger