-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE-170] Detect if there is no output and abort Step #801
Conversation
fe13255
to
a07f884
Compare
2db8c39
to
6beebe9
Compare
ac0f703
to
d49743f
Compare
d4cb289
to
61d1252
Compare
cli/run_config.go
Outdated
} | ||
|
||
func readNoOutputTimoutConfiguration(inventoryEnvironments []envmanModels.EnvironmentItemModel) time.Duration { | ||
const defaultTimeout = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a bit safer to use -1
as the off value here instead of 0
. A zero duration is something that other parts of the codebase can still interpret as a timeout and activate the hang detector accidentally.
tools/timeoutcmd/timeoutcmd.go
Outdated
c.timeout = timeout | ||
} | ||
|
||
// SetHangTimeout sets the timeout after which the command is killed when no output is received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no output is received on either stdout or stderr.
tools/timeoutcmd/timeoutcmd.go
Outdated
|
||
// SetHangTimeout sets the timeout after which the command is killed when no output is received. | ||
func (c *Command) SetHangTimeout(timeout time.Duration) { | ||
c.hangTimeout = timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be inside the if
too?
tools/hangdetector/hang_detector.go
Outdated
outWriter io.Writer | ||
} | ||
|
||
func tickerSettings(timeout time.Duration) (interval time.Duration, tickLimit uint64) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this private function should go below the public ones in this file
The env
BITRISE_NO_OUTPUT_TIMEOUT
can be used to set a timeout in seconds, after which if there is no output from the current Step then it is aborted. The option is disabled by default.I plant to add in following PRs:
Solves: https://bitrise.atlassian.net/browse/BE-170