Skip to content

Commit e78b7ae

Browse files
Make the hard timeout configurable
1 parent 0f06737 commit e78b7ae

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

api/config/unicorn.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
# stderr_path ...
4646

4747
worker_processes 1
48+
timeout FlightJobScriptAPI.config.hard_timeout
4849

4950
# NOTE: Unicorn does not appear to have an equivalent config option to puma's tag
5051
# IIRC this isn't hard to implement manually

api/etc/flight-job-script-api.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@
5757
#-------------------------------------------------------------------------------
5858
# command_timeout: 5
5959

60+
#-------------------------------------------------------------------------------
61+
# Hard Timeout
62+
# The maximum time a request can run for in seconds. Workers which exceed this
63+
# time will be terminated with SIGKILL.
64+
#
65+
# The environment variable flight_JOB_SCRIPT_API_hard_timeout takes precedence
66+
#-------------------------------------------------------------------------------
67+
# hard_timeout: 600
68+
6069
#-------------------------------------------------------------------------------
6170
# Shared Secret Path
6271
# Specify the path to to shared secret config. The secret must exist before the

api/lib/flight_job_script_api/configuration.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class ConfigError < StandardError; end
6969
env_var: true,
7070
default: '/usr/sbin:/usr/bin:/sbin:/bin'
7171
},
72+
{
73+
name: 'hard_timeout',
74+
env_var: true,
75+
default: 600
76+
},
7277
{
7378
name: 'command_timeout',
7479
env_var: true,

0 commit comments

Comments
 (0)