Skip to content

Commit 5cac33f

Browse files
committed
use local_termination_grace_seconds for LinuxSandbox timeout
1 parent b1c2e8d commit 5cac33f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.google.devtools.build.lib.events.Reporter;
3838
import com.google.devtools.build.lib.exec.TreeDeleter;
3939
import com.google.devtools.build.lib.exec.local.LocalEnvProvider;
40+
import com.google.devtools.build.lib.exec.local.LocalExecutionOptions;
4041
import com.google.devtools.build.lib.exec.local.PosixLocalEnvProvider;
4142
import com.google.devtools.build.lib.profiler.Profiler;
4243
import com.google.devtools.build.lib.profiler.SilentCloseable;
@@ -103,10 +104,11 @@ public static boolean isSupported(final CommandEnvironment cmdEnv) throws Interr
103104

104105
private static boolean computeIsSupported(CommandEnvironment cmdEnv, Path linuxSandbox)
105106
throws InterruptedException {
107+
LocalExecutionOptions options = cmdEnv.getOptions().getOptions(LocalExecutionOptions.class);
106108
ImmutableList<String> linuxSandboxArgv =
107109
LinuxSandboxCommandLineBuilder.commandLineBuilder(
108110
linuxSandbox, ImmutableList.of("/bin/true"))
109-
.setTimeout(Duration.ofSeconds(1))
111+
.setTimeout(options.getLocalSigkillGraceSeconds())
110112
.build();
111113
ImmutableMap<String, String> env = ImmutableMap.of();
112114
Path execRoot = cmdEnv.getExecRoot();

0 commit comments

Comments
 (0)