Skip to content

processor: add WaitForReadyContext method#393

Merged
frairon merged 1 commit intolovoo:masterfrom
tymeshifter:tymeshifter/wait-for-ready-improvement
Sep 20, 2022
Merged

processor: add WaitForReadyContext method#393
frairon merged 1 commit intolovoo:masterfrom
tymeshifter:tymeshifter/wait-for-ready-improvement

Conversation

@tymeshifter
Copy link
Contributor

@tymeshifter tymeshifter commented Sep 15, 2022

Currently the only option to test for processor readines is WaitForReady method.
This method is blocking until processor is ready.

When processor is dealing with long initialization, this call becomes unresponsive for virtually indefinite time. This behaviour is deal breaker for monitoring calls that just want to check on the status of the processor and return in reasonable amount of time i.e. Kubernetes healthcheck.

This change adds context aware method WaitForReadyContext that has all the same checks with addition to context cancelation check. This allows it to return when context is canceled with the context reported error. If the error is not nil it indicates that processor is not ready.

Currently the only option to test for processor readines is
WaitForReady method.
This method is blocking until processor is ready.
When processor is dealing with long initialization, this call
becomes unresponsive for virtually indefinite time.
This behaviour is deal breaker for monitoring calls that just
want to check on the status of the processor and return in reasonable
amount of time i.e. Kubernetes healthcheck.

This change adds context aware method WaitForReadyContext
that has all the same checks with addition to context cancelation
check. This allows it to return when context is canceled with the
context reported error. If the error is not nil it indicates that
processor is not ready.
Copy link
Contributor

@frairon frairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks @tymeshifter for that!
Any more comments from @jomaresch or @kavinsk1 maybe? 😁

@frairon frairon merged commit afb2f01 into lovoo:master Sep 20, 2022
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

Successfully merging this pull request may close these issues.

2 participants