Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys/reaper: avoid leaky goroutine when exec timeout
The channel is created with no capacity that it needs receiver when sending data. Otherwise, the sending-data goroutine will be blocked forever. For the #6166 pr, the exec command timeout will return and no receiver for the data. It will cause goroutine leaky. This commit allocates buffered channel for the command status and closes the channel after sending. And also use time.Timer with Stop for performance concern. Signed-off-by: Wei Fu <fuweid89@gmail.com>
- Loading branch information