fleet/pkg/scripts/scripts.go
Roberto Dip 3b00b70786
fix unreleased bugs for the increased script timeout (#15897)
for https://github.com/fleetdm/fleet/issues/15196. The main problem was
that we have two timeouts:

1. The timeout used by the host to kill the script execution
2. The timeout used by the server to wait for the script results

Before the changes in https://github.com/fleetdm/fleet/pull/15779, the
server timeout was longer than the host timeout, but we inadvertently
set both values to 5 minutes, which breaks the logic we have to handle
both kinds of timeouts.
2024-01-04 10:26:13 -03:00

16 lines
600 B
Go

// package scripts contains constants used by fleetd and the server to
// coordinate script execution timeouts.
package scripts
import "time"
const (
// MaxHostExecutionTime is the maximum time allowed for a script to run in a
// host before is terminated.
MaxHostExecutionTime = 5 * time.Minute
// MaxServerWaitTime is the maximum time allowed for the server to wait for
// hosts to run a script during syncronous execution. We add an extra buffer
// to account for the notification system used to deliver scripts to the
// host.
MaxServerWaitTime = MaxHostExecutionTime + 1*time.Minute
)