From f7c8be99443ab4ad88347b7aeda2b40699582ac0 Mon Sep 17 00:00:00 2001 From: Kamil Bukum Date: Wed, 18 Dec 2024 17:21:29 -0800 Subject: [PATCH 1/2] change default timeout into 15 mins. --- common/lib/dependabot/command_helpers.rb | 10 +++++----- common/lib/dependabot/shared_helpers.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/lib/dependabot/command_helpers.rb b/common/lib/dependabot/command_helpers.rb index f10aeff67b..9d87095270 100644 --- a/common/lib/dependabot/command_helpers.rb +++ b/common/lib/dependabot/command_helpers.rb @@ -11,11 +11,11 @@ module CommandHelpers extend T::Sig module TIMEOUTS - NO_TIME_OUT = -1 - LOCAL = 30 - NETWORK = 120 - LONG_RUNNING = 300 - DEFAULT = NETWORK + NO_TIME_OUT = -1 # No timeout + LOCAL = 30 # 30 seconds + NETWORK = 120 # 2 minutes + LONG_RUNNING = 300 # 5 minutes + DEFAULT = 900 # 15 minutes end class ProcessStatus diff --git a/common/lib/dependabot/shared_helpers.rb b/common/lib/dependabot/shared_helpers.rb index 650c913ae8..88d4bbcb22 100644 --- a/common/lib/dependabot/shared_helpers.rb +++ b/common/lib/dependabot/shared_helpers.rb @@ -159,7 +159,7 @@ def self.run_helper_subprocess(command:, function:, args:, env: nil, env_cmd = [env, cmd].compact if Experiments.enabled?(:enable_shared_helpers_command_timeout) - stdout, stderr, process = CommandHelpers.capture3_with_timeout( + stdout, stderr, process, _elapsed_time = CommandHelpers.capture3_with_timeout( env_cmd, stdin_data: stdin_data, timeout: timeout From 5517fd264a06f901f508923a1ed527c5517070db Mon Sep 17 00:00:00 2001 From: Kamil Bukum Date: Wed, 18 Dec 2024 18:03:30 -0800 Subject: [PATCH 2/2] remove not used elapsed_time --- common/lib/dependabot/shared_helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/dependabot/shared_helpers.rb b/common/lib/dependabot/shared_helpers.rb index 88d4bbcb22..f7d3bc0ec3 100644 --- a/common/lib/dependabot/shared_helpers.rb +++ b/common/lib/dependabot/shared_helpers.rb @@ -159,7 +159,7 @@ def self.run_helper_subprocess(command:, function:, args:, env: nil, env_cmd = [env, cmd].compact if Experiments.enabled?(:enable_shared_helpers_command_timeout) - stdout, stderr, process, _elapsed_time = CommandHelpers.capture3_with_timeout( + stdout, stderr, process = CommandHelpers.capture3_with_timeout( env_cmd, stdin_data: stdin_data, timeout: timeout @@ -453,7 +453,7 @@ def self.run_shell_command(command, env_cmd = [env || {}, cmd, opts].compact if Experiments.enabled?(:enable_shared_helpers_command_timeout) - stdout, stderr, process, _elapsed_time = CommandHelpers.capture3_with_timeout( + stdout, stderr, process = CommandHelpers.capture3_with_timeout( env_cmd, stderr_to_stdout: stderr_to_stdout, timeout: timeout