Skip to content
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

Timing error in watcher's sleep #272

Closed
KnVerey opened this issue Apr 6, 2018 · 2 comments
Closed

Timing error in watcher's sleep #272

KnVerey opened this issue Apr 6, 2018 · 2 comments
Assignees

Comments

@KnVerey
Copy link
Contributor

KnVerey commented Apr 6, 2018

Seen in version 0.18.1, but the lines of code in question hadn't changed for 7 months as of that version, so it's likely this is a rare edge case that has been possible for a long time.

lib/kubernetes-deploy/resource_watcher.rb:23:in `sleep': time interval must be positive (ArgumentError)
  from lib/kubernetes-deploy/resource_watcher.rb:23:in `run'
  from lib/kubernetes-deploy/deploy_task.rb:380:in `deploy_resources'
  from lib/kubernetes-deploy/deploy_task.rb:155:in `run!'
  from exe/kubernetes-deploy:67:in `<top (required)>'

@dturn
Copy link
Contributor

dturn commented Apr 6, 2018

Code in question is:
if Time.now.utc < delay_sync_until sleep(delay_sync_until - Time.now.utc) end

Easy fix ideas are saving the first call to Time.now.utc or [delay_sync_until, 0.1].max in the sleep call

@KnVerey
Copy link
Contributor Author

KnVerey commented Apr 6, 2018

I'm fine with either of those fixes. Interested in making the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants