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

Fix infinity loop caused by SIGINT while waiting for migration Pod to become ready #217

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

gregth
Copy link

@gregth gregth commented Oct 23, 2023

Currently, if the user sends a SIGINT (Ctrl+C) to the process while it is waiting for the migration Pod to become Ready, the process will enter an infinity loop, because:

  1. It will try to get the Pod from the API Server
  2. The client will return an error because the context is expired (due to SIGINT).
  3. It will continue to the next iteration of the loop.

This fix, before its iteration checks if the context is Done(), and if so, returns immediately an error to the caller.

Refs #216.

Currently, if the user sends a SIGINT (Ctrl+C) to the process while it
is waiting for the migration Pod to become Ready, the process will
enter an infinity loop, because:

1. It will try to get the Pod from the API Server
2. The client will return an error because the context is expired (due
   to SIGINT).
3. It will continue to the next iteration of the loop.

This fix, before its iteration checks if the context is Done(), and if
so, returns immediately an error to the caller.

Signed-off-by: Grigoris Thanasoulas <grigoris.thanasoulas@true.nl>
@laverya laverya merged commit b849368 into replicatedhq:main Nov 2, 2023
2 checks passed
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