Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support optional job timeout #770

Open
nathanweeks opened this issue Jul 18, 2024 · 0 comments
Open

Support optional job timeout #770

nathanweeks opened this issue Jul 18, 2024 · 0 comments

Comments

@nathanweeks
Copy link
Contributor

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?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant