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
runtime: differing timer behavior in goroutines between Go 1.14 and 1.15 #41606
Comments
/assign @evanphx @bmizerany @uggedal @benburkert |
This is not the Kubernetes repository, closing. |
It looks like OP is reporting a difference in behaviour between two Go versions (1.14 and 1.15), though. |
Apologies, I misread the post. Will reopen. |
Never mind, thanks for checking the issue. |
It seems like this was fixed between k8s.io/apimachinery v0.18.2 and v0.19.2 (latest version). It reproduces for me on v0.18.2, but not v0.19.2. |
Probably kubernetes/apimachinery@49ae5f6, which completely changed the internal implementation. It is possible that something changed between 1.14 and 1.15 that changed the behavior of |
Testing it, it looks like it might be a race condition somewhere, it reliably reproduces on
|
I tried this version, However, it is strange that I will continue to read the code in |
@wangao1236 please please do not tag random people in assignment, it's extremely rude. |
The Go timer support was rewritten in Go 1.15. If there was a race condition in the old Kubernetes code, as suggested by the fact that the problem sometimes occurred with 1.14, then it is not surprising that the behavior changed between Go 1.14 and 1.15. It sounds to me like everything is working fine with current Kubernetes code, and it sounds like there may have been a problem with the old Kubernetes code, so there doesn't seem to be a reason to keep this issue open. Happy to hear otherwise. |
Sorry |
Perhaps the difference between
I think the problem is k8s. Thank you for everyone's help. I will close this issue. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I used a package called "k8s.io/apimachinery v0.18.2", the package has a function called wait.Until, it is a polling function, that can set the interval. The script is as follows:
What did you expect to see?
I want the polling function to run every one minute. Running logs under version 1.14.1 is as follows:
What did you see instead?
But in the new version, when the program starts, the polling function executes twice in a row, then every other minute. The first round was executed one more time. Running logs under version 1.15.2 is as follows:
The text was updated successfully, but these errors were encountered: