rbbt-util 5.25.1 → 5.25.3

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: 90520a5d90fb50559c81af63d6dc6160a5c0b3b7
4
- data.tar.gz: 3bd6c4c62ae7005de91c309e9ca25a97e4dd5225
3
+ metadata.gz: 54fa4586d586432080dada81ffa2e9bb5855c947
4
+ data.tar.gz: 45cec7e1aa0666389e5af932de660220db04154b
5
5
  SHA512:
6
- metadata.gz: 9596ac571a80a8519a0a0e1fe333a74fc500705ff962591253d5f22ca6b17e38040f06d0351f8c923b8f6ba35853d1e0fea808b392f60712b6384388e4b1d2f7
7
- data.tar.gz: 135ced6644d8628df1f58de6be2a310367ed90897e4bd3628e9177f86b7aff1701ef2aec99b8516b8f27ba4e7fbb01b6a54aaca375434189d8d9395447a6152e
6
+ metadata.gz: 41a13012b722603f8ed7e077afe973b57e92f7d42f65cc5d276b5fdf5622fa556e578de1263641fddbae02ae5f1f8ac8c046712a33d68a11e14f33098a35e25a
7
+ data.tar.gz: dced005598f84d98de39887d9c3f1cb89eaff0b29d872c01abb23605f998ca0ecad2d444526ee49c68fe7d633d575609634c245b68e9d89e95e33b59405cdb97
@@ -158,7 +158,7 @@ class WorkflowRESTClient
158
158
 
159
159
  def done?
160
160
  init_job unless @url
161
- @done || status.to_s == 'done'
161
+ @done || status.to_s == 'done' || status.to_s == 'noinfo'
162
162
  end
163
163
 
164
164
  def files
@@ -136,7 +136,7 @@ class Step
136
136
  end
137
137
 
138
138
  dependency.status_lock.synchronize do
139
- if dependency.aborted? || (dependency.error? && dependency.recoverable_error? && ! canfail_paths.include?(dependency.path) && ! already_failed << dependency.path) || (!Open.remote?(dependency.path) && dependency.missing?)
139
+ if dependency.aborted? || (dependency.error? && dependency.recoverable_error? && ! canfail_paths.include?(dependency.path) && ! already_failed.include?(dependency.path)) || (!Open.remote?(dependency.path) && dependency.missing?)
140
140
  Log.warn "Cleaning dep. on exec #{Log.color :blue, dependency.path} (missing: #{dependency.missing?}; error #{dependency.error?})"
141
141
  dependency.clean
142
142
  already_failed << dependency.path
@@ -476,16 +476,21 @@ class Step
476
476
  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]
477
477
  sout, sin = Misc.pipe if no_load == :stream
478
478
  @pid = Process.fork do
479
+ Signal.trap(:TERM) do
480
+ raise Aborted, "Recieved TERM Signal on forked process #{Process.pid}"
481
+ end
479
482
  sout.close if sout
480
483
  Misc.pre_fork
484
+ Open.mkdir File.dirname(path) unless Open.exist?(File.dirname(path))
485
+ Open.write(pid_file, Process.pid.to_s) unless Open.exists?(path) or Open.exists?(pid_file)
486
+
487
+ if semaphore
488
+ init_info
489
+ log :queue, "Queued over semaphore: #{semaphore}"
490
+ ret = RbbtSemaphore.wait_semaphore(semaphore)
491
+ raise SemaphoreInterrupted if ret == -1
492
+ end
481
493
  begin
482
- Open.mkdir File.dirname(path) unless Open.exist?(File.dirname(path))
483
- Open.write(pid_file, Process.pid.to_s) unless Open.exists?(path) or Open.exists?(pid_file)
484
- if semaphore
485
- init_info
486
- log :queue, "Queued over semaphore: #{semaphore}"
487
- RbbtSemaphore.wait_semaphore(semaphore)
488
- end
489
494
  begin
490
495
  @forked = true
491
496
  res = run no_load
@@ -547,7 +552,7 @@ class Step
547
552
  end
548
553
 
549
554
  def abort_pid
550
- @pid ||= info[:pid]
555
+ @pid ||= info[:pid] || Open.read(pid_file)
551
556
 
552
557
  case @pid
553
558
  when nil
@@ -557,14 +562,14 @@ class Step
557
562
  Log.medium "Could not abort #{path}: same process"
558
563
  false
559
564
  else
560
- Log.medium "Aborting pid #{path}: #{ @pid }"
565
+ Log.medium "Aborting pid #{path}: #{ @pid } #{Process.pid}"
561
566
  begin
562
- Process.kill("INT", @pid)
563
- Process.waitpid @pid
567
+ Process.kill("TERM", @pid.to_i)
568
+ s = Process.waitpid2 @pid.to_i
569
+ Log.medium "Aborted pid #{path}: #{ @pid } #{s.exitstatus}"
564
570
  rescue Exception
565
571
  Log.debug("Aborted job #{@pid} was not killed: #{$!.message}")
566
572
  end
567
- Log.medium "Aborted pid #{path}: #{ @pid }"
568
573
  true
569
574
  end
570
575
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.25.1
4
+ version: 5.25.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez