Skip to content

Support optional job timeout #770

Description

@nathanweeks

To prevent runaway blast jobs from blocking a sequenceserver instance, it would be helpful to support an optional/configurable job timeout with descriptive error message in the event of a timeout.

As a stopgap, a user might hard-code a CPU time limit:

--- a/lib/sequenceserver/sys.rb
+++ b/lib/sequenceserver/sys.rb
@@ -45,6 +45,8 @@ module SequenceServer
       # Change to the specified directory.
       Dir.chdir(options[:dir]) if options[:dir] && Dir.exist?(options[:dir])
 
+      Process::setrlimit(:CPU, 300) # 5-minute timeout
+
       # Execute the shell command, redirect stdout and stderr to the
       # temporary files.
       exec(command, out: temp_files[:stdout].path.to_s, \

Though in the event of a timeout, the resulting error message is misleading at best ("BLAST query/options error: Invalid input format for BLAST Archive. Please refer to the BLAST+ user manual."), and a wall-time limit would be preferable---perhaps with the timeout module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions