You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use the following shell script as a probe and example.com does not return a response for a long time, an execution of the probe will not stop in the specified timeout.
An example of configuration file for goma is as follows.
[[monitor]]
name = "example"interval = 1timeout = 1
[monitor.probe]
type = "exec"command = "/path/to/probe"
[[monitor.actions]]
type = "mail"from = "[email protected]"fail_to = ["[email protected]"]
The reason for this is as follows.
exec.CommandContext with context.WithTimeout will kill the process of the probe when the specified time has elapsed. However, the process of nc (the child process of the process of the probe) will not be killed since goma does not kill the whole process group.
If nc does not close its stdout, cmd.Output() will wait to copy the nc process's stdout into the buffer.
When we use the following shell script as a probe and example.com does not return a response for a long time, an execution of the probe will not stop in the specified timeout.
An example of configuration file for goma is as follows.
The reason for this is as follows.
exec.CommandContext
withcontext.WithTimeout
will kill the process of the probe when the specified time has elapsed. However, the process of nc (the child process of the process of the probe) will not be killed since goma does not kill the whole process group.cmd.Output()
will wait to copy the nc process's stdout into the buffer.See: golang/go#18874 (comment)
The text was updated successfully, but these errors were encountered: