rbbt-util 5.11.6 → 5.11.7

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: 2230976fc29ab61ab320c1c007521196acaa9b5f
4
- data.tar.gz: 60ea71f47e8afa071cdc84f7de115487ec0b1ac5
3
+ metadata.gz: a0b0c06dd413bbda58854a7049a059bf5063fbfc
4
+ data.tar.gz: ecd6b277d6914343a6a3ad9c6cf60aa2ccb7f9ff
5
5
  SHA512:
6
- metadata.gz: 8f7bbea5678b31d6f49ce13f94dd0b7d3271ae6e187ea837265e202ee90e95c3cb8af27ae5ba8c05b3dd8fa5d0d6eca14ae7870685990ae391fdfb1273ddbac8
7
- data.tar.gz: d4746fa8d4393a9f7c399ae766b1881bc41568793ed50722a4b4f101a54962146fead34931b393c8ca44b3ea17057f59b21f505d7336939b777ede2983f9ddc9
6
+ metadata.gz: 7c54603a690dd9aed68719cf07641252a80e2705b523601856202afaff71a7aaea4b5af91da396795a9f0a80b7f7edbfa2d638f1d8464396b37c5e82e83128e0
7
+ data.tar.gz: 6286a580ecef53c0c2509c52a2b4a322e71399812d1de75b3d800d5f1175c0a0c4bccbe1ec9ff35ad8e431a11a41a362d3882f0ad8c816b9b2c12b25c269c42a
@@ -3,7 +3,6 @@ require 'rbbt/persist/tsv'
3
3
  require 'rbbt/util/log'
4
4
  require 'rbbt/util/semaphore'
5
5
  require 'rbbt/workflow/accessor'
6
- require 'rbbt/workflow/step/run'
7
6
 
8
7
  class Step
9
8
  attr_accessor :path, :task, :inputs, :dependencies, :bindings
@@ -180,3 +179,5 @@ class Step
180
179
  end.first
181
180
  end
182
181
  end
182
+
183
+ require 'rbbt/workflow/step/run'
@@ -19,7 +19,7 @@ class Step
19
19
 
20
20
  def exec(no_load=false)
21
21
  dependencies.each{|dependency| dependency.exec(no_load) }
22
- @result = _exec
22
+ @result = self._exec
23
23
  @result = @result.stream if TSV::Dumper === @result
24
24
  no_load ? @result : prepare_result(@result, @task.result_description)
25
25
  end
@@ -188,7 +188,7 @@ class Step
188
188
  end
189
189
 
190
190
  def fork(semaphore = nil)
191
- raise "Can not fork: Step is waiting for proces #{@pid} to finish" if not @pid.nil? and not Process.pid == @pid
191
+ raise "Can not fork: Step is waiting for proces #{@pid} to finish" if not @pid.nil? and not Process.pid == @pid and Misc.pid_exists?(@pid) and not done? and info[:forked]
192
192
  @pid = Process.fork do
193
193
  begin
194
194
  RbbtSemaphore.wait_semaphore(semaphore) if semaphore
@@ -300,23 +300,23 @@ class Step
300
300
  join_stream
301
301
 
302
302
  return if not Open.exists? info_file
303
- @pid ||= info[:pid]
303
+ pid = @pid
304
304
 
305
305
  Misc.insist [0.1, 0.2, 0.5, 1] do
306
- @pid ||= info[:pid]
306
+ pid ||= info[:pid]
307
307
  end
308
308
 
309
- if @pid.nil?
309
+ if pid.nil?
310
310
  dependencies.each{|dep| dep.join }
311
311
  self
312
312
  else
313
313
  begin
314
- Log.debug{"Waiting for pid: #{@pid}"}
315
- Process.waitpid @pid
314
+ Log.debug{"Waiting for pid: #{pid}"}
315
+ Process.waitpid pid
316
316
  rescue Errno::ECHILD
317
- Log.debug{"Process #{ @pid } already finished: #{ path }"}
318
- end if Misc.pid_exists? @pid
319
- @pid = nil
317
+ Log.debug{"Process #{ pid } already finished: #{ path }"}
318
+ end if Misc.pid_exists? pid
319
+ pid = nil
320
320
  dependencies.each{|dep| dep.join }
321
321
  self
322
322
  end
@@ -121,7 +121,8 @@ class TestWorkflow < Test::Unit::TestCase
121
121
  "bar"
122
122
  end
123
123
 
124
- assert_equal 'bar', a.job(:foo).exec
124
+ job = a.job(:foo)
125
+ assert_equal 'bar', job.exec
125
126
  end
126
127
 
127
128
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.11.6
4
+ version: 5.11.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake