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 +4 -4
- data/lib/rbbt/rest/client/step.rb +1 -1
- data/lib/rbbt/workflow/step/dependencies.rb +1 -1
- data/lib/rbbt/workflow/step/run.rb +17 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54fa4586d586432080dada81ffa2e9bb5855c947
|
4
|
+
data.tar.gz: 45cec7e1aa0666389e5af932de660220db04154b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41a13012b722603f8ed7e077afe973b57e92f7d42f65cc5d276b5fdf5622fa556e578de1263641fddbae02ae5f1f8ac8c046712a33d68a11e14f33098a35e25a
|
7
|
+
data.tar.gz: dced005598f84d98de39887d9c3f1cb89eaff0b29d872c01abb23605f998ca0ecad2d444526ee49c68fe7d633d575609634c245b68e9d89e95e33b59405cdb97
|
@@ -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
|
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("
|
563
|
-
Process.
|
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
|