Skip to content

Commit

Permalink
Rescue systemu errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mooreryan committed Feb 21, 2019
1 parent 204cde8 commit 4747607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ RUN mv mafft-linux64/* .

RUN gem install bundler

RUN \curl -sSL https://github.com/mooreryan/pasv/archive/v1.1.5.tar.gz \
RUN \curl -sSL https://github.com/mooreryan/pasv/archive/v1.1.6.tar.gz \
| tar -v -C /home -xz
RUN mv /home/pasv-1.1.5 /home/pasv
RUN mv /home/pasv-1.1.6 /home/pasv

WORKDIR /home/pasv
RUN bundle install
Expand Down
9 changes: 5 additions & 4 deletions pasv
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PasvLib.extend PasvLib::Utils
Time.extend PasvLib::CoreExtensions::Time
Process.extend PasvLib::CoreExtensions::Process

PIPELINE_VERSION = "1.1.5"
PIPELINE_VERSION = "1.1.6"
VERSION_BANNER = %Q{ # Pipeline version: #{PIPELINE_VERSION}
# Lib version: #{PasvLib::VERSION}
# Copyright 2017 - 2018 Ryan Moore
Expand Down Expand Up @@ -190,6 +190,7 @@ until unfinished_queries.empty?
cmd = "#{opts[:aligner]} #{opts[:alignment_parameters]} #{io_str}"

begin
# This can raise either AbortIf::Exit or SystemUniversal::Error
Process.run_it! cmd
recs = {}
query_rec = []
Expand Down Expand Up @@ -244,9 +245,9 @@ until unfinished_queries.empty?
# map() will return this
[:not_done, [query_head, ungapped_query_seq, query_idx]]
end
rescue AbortIf::Exit
rescue AbortIf::Exit, SystemUniversal::Error => e
# it failed so mark it and keep going
AbortIf.logger.error { "Query #{query_idx} failed. Will try again later." }
AbortIf.logger.error { "Query #{query_idx} failed with error #{e.inspect}. Will try again later." }

FileUtils.rm aln_infile if File.exist? aln_infile
FileUtils.rm aln_outfile if File.exist? aln_outfile
Expand All @@ -258,7 +259,7 @@ until unfinished_queries.empty?
rescue Parallel::DeadWorker => e
# In case anything goes wrong outside of the mafft alignment to
# kill the worker.
AbortIf::logger.error { "There was an error in one or more of the worker threads." }
AbortIf::logger.error { "There was an error in one or more of the worker threads. (#{e.inspect})" }
abort
end

Expand Down

0 comments on commit 4747607

Please sign in to comment.