-
Notifications
You must be signed in to change notification settings - Fork 10
Improve restart of pmc montoring #113
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
base: main
Are you sure you want to change the base?
Improve restart of pmc montoring #113
Conversation
|
Thanks for your PR, |
pkg/daemon/daemon.go
Outdated
| go pmc.Poll() | ||
| for { // Wait for pmc.parentDS to be updated by Poll | ||
| time.Sleep(10 * time.Millisecond) | ||
| if pmc.parentDS != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If RunPMCExpGetParentDS fails, this will never exit this loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if the poll fails the expect should pick up a change at some point so it might be delayed but should exit in decent time pratically.
I can add a timeout if you'd like I'll just make sure its so long we are unlikely to hit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for context this function is called when cloud-event-proxy start/restarts to emit the clock class. So either we're starting up and will receive/update in not long or will already have it so won't enter this block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've realised I don't actually need the poll here so I just removed it and left a comment on why we can skip.
The polling interval was cause delays in killing processed My moving into a go routine processes it no longer blocks actions such as stopping the process.
eb0b789 to
ea5deff
Compare
The polling interval was cause delays in killing processed by moving into a go routine processes it no longer blocks actions such as stopping the process.