rbbt-util 5.21.39 → 5.21.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/util/concurrency/processes/worker.rb +12 -3
- data/lib/rbbt/workflow/accessor.rb +4 -2
- data/lib/rbbt/workflow/step/dependencies.rb +12 -3
- data/lib/rbbt/workflow/step/run.rb +16 -3
- metadata +63 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7e3095c61e3d45f4d025495616012edd657e844
|
4
|
+
data.tar.gz: f009065701ca1bb5fc077352d950a41c1448fd6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6761bc6d733ef4f82e18069314df062512f53ef0f8aefdea400a6cfe63dc64939feb0570d77ff1ad1dd1edb92273024b2c240348bf11c16352b29a87953b383
|
7
|
+
data.tar.gz: c2e35aea73309e61fcd0d20df6e8d88b7412f7e7d513b99199e8bd9fbcb8b73d8a406d966f5505f6d52b458df5c02e697e57b3f1c717a810ba899dfe56ffe44e
|
@@ -21,6 +21,12 @@ class RbbtProcessQueue
|
|
21
21
|
@stop = true
|
22
22
|
}
|
23
23
|
|
24
|
+
@abort = false
|
25
|
+
Signal.trap(:USR2){
|
26
|
+
@abort = true
|
27
|
+
}
|
28
|
+
|
29
|
+
|
24
30
|
loop do
|
25
31
|
p = @queue.pop
|
26
32
|
next if p.nil?
|
@@ -34,6 +40,7 @@ class RbbtProcessQueue
|
|
34
40
|
raise $!
|
35
41
|
end
|
36
42
|
raise Respawn if @stop
|
43
|
+
raise Aborted if @abort
|
37
44
|
end
|
38
45
|
Kernel.exit! 0
|
39
46
|
rescue Respawn
|
@@ -103,7 +110,6 @@ class RbbtProcessQueue
|
|
103
110
|
rescue Aborted, Interrupt
|
104
111
|
Log.warn "Worker #{Process.pid} aborted"
|
105
112
|
Kernel.exit! 0
|
106
|
-
Process.kill "INT", @current
|
107
113
|
rescue Exception
|
108
114
|
Log.exception $!
|
109
115
|
raise $!
|
@@ -148,13 +154,16 @@ class RbbtProcessQueue
|
|
148
154
|
|
149
155
|
def join
|
150
156
|
Process.waitpid @pid
|
151
|
-
raise ProcessFailed
|
157
|
+
raise ProcessFailed if not $?.success?
|
152
158
|
end
|
153
159
|
|
154
160
|
def abort
|
155
161
|
begin
|
162
|
+
Process.kill :USR2, @pid
|
156
163
|
Process.kill :INT, @pid
|
157
|
-
rescue
|
164
|
+
rescue Errno::ESRCH
|
165
|
+
rescue Exception
|
166
|
+
Log.exception $!
|
158
167
|
end
|
159
168
|
end
|
160
169
|
|
@@ -339,7 +339,7 @@ class Step
|
|
339
339
|
return false unless error?
|
340
340
|
begin
|
341
341
|
klass = Kernel.const_get(info[:exception][:class])
|
342
|
-
not RbbtException === klass
|
342
|
+
not (RbbtException == klass or RbbtException === klass)
|
343
343
|
rescue Exception
|
344
344
|
false
|
345
345
|
end
|
@@ -350,7 +350,7 @@ class Step
|
|
350
350
|
end
|
351
351
|
|
352
352
|
def dirty?
|
353
|
-
rec_dependencies.collect{|dependency| dependency.path }.uniq.reject{|path| not Path === path or path.exists?}.any?
|
353
|
+
rec_dependencies.collect{|dependency| dependency.path unless dependency.error? and not dependency.recoverable_error? }.compact.uniq.reject{|path| not Path === path or path.exists?}.any?
|
354
354
|
end
|
355
355
|
|
356
356
|
def done?
|
@@ -366,6 +366,8 @@ class Step
|
|
366
366
|
pid = info[:pid]
|
367
367
|
return nil if pid.nil?
|
368
368
|
|
369
|
+
return false if done? or error? or aborted? or not started?
|
370
|
+
|
369
371
|
if Misc.pid_exists?(pid)
|
370
372
|
pid
|
371
373
|
else
|
@@ -199,8 +199,12 @@ class Step
|
|
199
199
|
begin
|
200
200
|
step.produce
|
201
201
|
rescue Exception
|
202
|
-
step.
|
203
|
-
|
202
|
+
step.exception $!
|
203
|
+
if step.recoverable_error?
|
204
|
+
raise $!
|
205
|
+
else
|
206
|
+
raise StopInsist.new($!)
|
207
|
+
end
|
204
208
|
end
|
205
209
|
end
|
206
210
|
nil
|
@@ -221,7 +225,12 @@ class Step
|
|
221
225
|
raise $!
|
222
226
|
rescue Exception
|
223
227
|
dep.exception $!
|
224
|
-
|
228
|
+
dep.exception $!
|
229
|
+
if dep.recoverable_error?
|
230
|
+
raise $!
|
231
|
+
else
|
232
|
+
raise StopInsist.new($!)
|
233
|
+
end
|
225
234
|
end
|
226
235
|
end
|
227
236
|
nil
|
@@ -54,7 +54,12 @@ class Step
|
|
54
54
|
def _exec
|
55
55
|
resolve_input_steps
|
56
56
|
@exec = true if @exec.nil?
|
57
|
-
|
57
|
+
begin
|
58
|
+
old = Signal.trap("INT"){ Thread.current.raise Aborted }
|
59
|
+
@task.exec_in((bindings ? bindings : self), *@inputs)
|
60
|
+
ensure
|
61
|
+
Signal.trap("INT", old)
|
62
|
+
end
|
58
63
|
end
|
59
64
|
|
60
65
|
def exec(no_load=false)
|
@@ -119,6 +124,7 @@ class Step
|
|
119
124
|
rescue Exception
|
120
125
|
FileUtils.rm pid_file if File.exist?(pid_file)
|
121
126
|
stop_dependencies
|
127
|
+
Log.exception $!
|
122
128
|
raise $!
|
123
129
|
end
|
124
130
|
|
@@ -237,6 +243,8 @@ class Step
|
|
237
243
|
exception $!
|
238
244
|
stop_dependencies
|
239
245
|
raise $!
|
246
|
+
ensure
|
247
|
+
set_info :pid, nil
|
240
248
|
end
|
241
249
|
end
|
242
250
|
|
@@ -248,11 +256,16 @@ class Step
|
|
248
256
|
if force or aborted? or recoverable_error?
|
249
257
|
clean
|
250
258
|
else
|
251
|
-
|
259
|
+
e = get_exception
|
260
|
+
if e
|
261
|
+
raise e
|
262
|
+
else
|
263
|
+
raise "Error in job: #{self.path}"
|
264
|
+
end
|
252
265
|
end
|
253
266
|
end
|
254
267
|
|
255
|
-
clean if dirty?
|
268
|
+
clean if dirty?
|
256
269
|
|
257
270
|
if dofork
|
258
271
|
fork(true) unless started?
|
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.21.
|
4
|
+
version: 5.21.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -487,82 +487,82 @@ signing_key:
|
|
487
487
|
specification_version: 4
|
488
488
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|
489
489
|
test_files:
|
490
|
-
- test/
|
490
|
+
- test/rbbt/test_workflow.rb
|
491
491
|
- test/rbbt/resource/test_path.rb
|
492
|
-
- test/rbbt/association/test_item.rb
|
493
|
-
- test/rbbt/association/test_database.rb
|
494
|
-
- test/rbbt/association/test_open.rb
|
495
|
-
- test/rbbt/association/test_index.rb
|
496
|
-
- test/rbbt/association/test_util.rb
|
497
|
-
- test/rbbt/util/test_concurrency.rb
|
498
|
-
- test/rbbt/util/test_log.rb
|
499
|
-
- test/rbbt/util/test_chain_methods.rb
|
500
|
-
- test/rbbt/util/test_simpleopt.rb
|
501
|
-
- test/rbbt/util/simpleopt/test_parse.rb
|
502
|
-
- test/rbbt/util/simpleopt/test_get.rb
|
503
|
-
- test/rbbt/util/simpleopt/test_setup.rb
|
504
492
|
- test/rbbt/util/test_cmd.rb
|
505
|
-
- test/rbbt/util/
|
506
|
-
- test/rbbt/util/
|
507
|
-
- test/rbbt/util/
|
508
|
-
- test/rbbt/util/
|
509
|
-
- test/rbbt/util/test_tmpfile.rb
|
510
|
-
- test/rbbt/util/test_open.rb
|
511
|
-
- test/rbbt/util/test_filecache.rb
|
512
|
-
- test/rbbt/util/R/test_eval.rb
|
513
|
-
- test/rbbt/util/R/test_model.rb
|
493
|
+
- test/rbbt/util/simpleopt/test_setup.rb
|
494
|
+
- test/rbbt/util/simpleopt/test_get.rb
|
495
|
+
- test/rbbt/util/simpleopt/test_parse.rb
|
496
|
+
- test/rbbt/util/test_chain_methods.rb
|
514
497
|
- test/rbbt/util/test_simpleDSL.rb
|
515
|
-
- test/rbbt/util/
|
516
|
-
- test/rbbt/util/
|
517
|
-
- test/rbbt/util/test_R.rb
|
498
|
+
- test/rbbt/util/test_log.rb
|
499
|
+
- test/rbbt/util/test_open.rb
|
518
500
|
- test/rbbt/util/misc/test_lock.rb
|
519
|
-
- test/rbbt/util/misc/
|
501
|
+
- test/rbbt/util/misc/test_multipart_payload.rb
|
520
502
|
- test/rbbt/util/misc/test_bgzf.rb
|
503
|
+
- test/rbbt/util/misc/test_pipes.rb
|
521
504
|
- test/rbbt/util/misc/test_omics.rb
|
522
|
-
- test/rbbt/util/
|
505
|
+
- test/rbbt/util/test_concurrency.rb
|
506
|
+
- test/rbbt/util/test_R.rb
|
507
|
+
- test/rbbt/util/log/test_progress.rb
|
508
|
+
- test/rbbt/util/test_colorize.rb
|
509
|
+
- test/rbbt/util/test_simpleopt.rb
|
523
510
|
- test/rbbt/util/test_excel2tsv.rb
|
511
|
+
- test/rbbt/util/test_filecache.rb
|
512
|
+
- test/rbbt/util/concurrency/test_processes.rb
|
513
|
+
- test/rbbt/util/concurrency/test_threads.rb
|
514
|
+
- test/rbbt/util/concurrency/processes/test_socket.rb
|
515
|
+
- test/rbbt/util/test_semaphore.rb
|
524
516
|
- test/rbbt/util/test_misc.rb
|
517
|
+
- test/rbbt/util/test_tmpfile.rb
|
518
|
+
- test/rbbt/util/R/test_model.rb
|
519
|
+
- test/rbbt/util/R/test_eval.rb
|
520
|
+
- test/rbbt/test_packed_index.rb
|
521
|
+
- test/rbbt/entity/test_identifiers.rb
|
522
|
+
- test/rbbt/test_association.rb
|
523
|
+
- test/rbbt/knowledge_base/test_traverse.rb
|
524
|
+
- test/rbbt/knowledge_base/test_registry.rb
|
525
|
+
- test/rbbt/knowledge_base/test_entity.rb
|
526
|
+
- test/rbbt/knowledge_base/test_enrichment.rb
|
527
|
+
- test/rbbt/knowledge_base/test_syndicate.rb
|
528
|
+
- test/rbbt/knowledge_base/test_query.rb
|
529
|
+
- test/rbbt/test_resource.rb
|
525
530
|
- test/rbbt/test_entity.rb
|
531
|
+
- test/rbbt/test_knowledge_base.rb
|
532
|
+
- test/rbbt/annotations/test_util.rb
|
533
|
+
- test/rbbt/association/test_index.rb
|
534
|
+
- test/rbbt/association/test_item.rb
|
535
|
+
- test/rbbt/association/test_open.rb
|
536
|
+
- test/rbbt/association/test_util.rb
|
537
|
+
- test/rbbt/association/test_database.rb
|
538
|
+
- test/rbbt/test_tsv.rb
|
526
539
|
- test/rbbt/workflow/step/test_dependencies.rb
|
527
|
-
- test/rbbt/workflow/test_doc.rb
|
528
|
-
- test/rbbt/workflow/test_step.rb
|
529
540
|
- test/rbbt/workflow/test_task.rb
|
530
|
-
- test/rbbt/
|
531
|
-
- test/rbbt/
|
532
|
-
- test/rbbt/
|
533
|
-
- test/rbbt/
|
541
|
+
- test/rbbt/workflow/test_step.rb
|
542
|
+
- test/rbbt/workflow/test_doc.rb
|
543
|
+
- test/rbbt/test_monitor.rb
|
544
|
+
- test/rbbt/test_persist.rb
|
545
|
+
- test/rbbt/test_annotations.rb
|
546
|
+
- test/rbbt/persist/test_tsv.rb
|
547
|
+
- test/rbbt/persist/tsv/test_lmdb.rb
|
548
|
+
- test/rbbt/persist/tsv/test_kyotocabinet.rb
|
549
|
+
- test/rbbt/persist/tsv/test_sharder.rb
|
550
|
+
- test/rbbt/persist/tsv/test_cdb.rb
|
551
|
+
- test/rbbt/persist/tsv/test_tokyocabinet.rb
|
552
|
+
- test/rbbt/persist/tsv/test_leveldb.rb
|
553
|
+
- test/rbbt/tsv/test_field_index.rb
|
534
554
|
- test/rbbt/tsv/test_parallel.rb
|
535
|
-
- test/rbbt/tsv/
|
555
|
+
- test/rbbt/tsv/test_index.rb
|
556
|
+
- test/rbbt/tsv/test_matrix.rb
|
536
557
|
- test/rbbt/tsv/test_change_id.rb
|
558
|
+
- test/rbbt/tsv/test_parser.rb
|
537
559
|
- test/rbbt/tsv/test_stream.rb
|
560
|
+
- test/rbbt/tsv/test_util.rb
|
561
|
+
- test/rbbt/tsv/test_accessor.rb
|
538
562
|
- test/rbbt/tsv/test_filter.rb
|
539
|
-
- test/rbbt/tsv/test_matrix.rb
|
540
563
|
- test/rbbt/tsv/test_attach.rb
|
541
564
|
- test/rbbt/tsv/test_manipulate.rb
|
542
|
-
- test/rbbt/tsv/
|
543
|
-
- test/rbbt/tsv/
|
544
|
-
- test/rbbt/tsv/test_util.rb
|
545
|
-
- test/rbbt/tsv/test_parser.rb
|
546
|
-
- test/rbbt/test_packed_index.rb
|
547
|
-
- test/rbbt/test_persist.rb
|
565
|
+
- test/rbbt/tsv/parallel/test_through.rb
|
566
|
+
- test/rbbt/tsv/parallel/test_traverse.rb
|
548
567
|
- test/rbbt/test_fix_width_table.rb
|
549
|
-
- test/
|
550
|
-
- test/rbbt/knowledge_base/test_entity.rb
|
551
|
-
- test/rbbt/knowledge_base/test_query.rb
|
552
|
-
- test/rbbt/knowledge_base/test_enrichment.rb
|
553
|
-
- test/rbbt/knowledge_base/test_syndicate.rb
|
554
|
-
- test/rbbt/knowledge_base/test_registry.rb
|
555
|
-
- test/rbbt/entity/test_identifiers.rb
|
556
|
-
- test/rbbt/test_monitor.rb
|
557
|
-
- test/rbbt/test_workflow.rb
|
558
|
-
- test/rbbt/test_annotations.rb
|
559
|
-
- test/rbbt/annotations/test_util.rb
|
560
|
-
- test/rbbt/test_resource.rb
|
561
|
-
- test/rbbt/persist/tsv/test_tokyocabinet.rb
|
562
|
-
- test/rbbt/persist/tsv/test_kyotocabinet.rb
|
563
|
-
- test/rbbt/persist/tsv/test_lmdb.rb
|
564
|
-
- test/rbbt/persist/tsv/test_leveldb.rb
|
565
|
-
- test/rbbt/persist/tsv/test_cdb.rb
|
566
|
-
- test/rbbt/persist/tsv/test_sharder.rb
|
567
|
-
- test/rbbt/persist/test_tsv.rb
|
568
|
-
- test/rbbt/test_tsv.rb
|
568
|
+
- test/test_helper.rb
|