-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
taskrun timeouts: fix timeout goroutines
- Do not start two go routines π, my bad, I messed up a rebase on my part brought an additional timeout goroutine π. - Use a channel (started) to make sure we start the timeout timer in time at the time we issue the `go β¦` call. When using the `go` keyword to start a goroutines, there is no guarantee the code inside the go routine will start right away. The scheduler might (and most likely will) wait for the main goroutine (or the caller goroutine) to have a waiting/sleeping time, to start working in the issued go routine. This means, that before that fix, we have no guarantee we started the timer at the right time β especially if the controller is very busy. Passing a channel and waiting for it to be closed just after the `go β¦` call forces the scheduler to sleep and run the goroutine's code. Which, in our case, that we started the timeout timer at the right time. Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
7441ebe
commit 2bb7678
Showing
3 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters