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

Attempt to create the che project multiple times if it was previously deleted. #13443

Merged
merged 3 commits into from Jun 3, 2019

Conversation

metlos
Copy link
Contributor

@metlos metlos commented May 29, 2019

Each attempt waits exponentially longer before retry.

This should enable us to redeploy che using just a single invocation of deploy_che.sh.

deleted.

Each attempt waits exponentially longer before retry.
This should enable us to redeploy che using just a single invocation
of deploy_che.sh.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@sleshchenko
Copy link
Member

Does it fix #10409 ?

@skabashnyuk
Copy link
Contributor

Can you explain the issue (usecase) and the way how you fix it? In general.

@metlos
Copy link
Contributor Author

metlos commented May 29, 2019

Does it fix #10409 ?

Yes, in a slightly different way than originally - the wait time exponentially increases between each attempt (which I'm not sure is ideal but it works)

Can you explain the issue (usecase) and the way how you fix it? In general.

$ oc delete project X
$ sleep 5
$ oc get project X
... nothing returned
$ oc new-project X
AlreadyExists exception

The way to fix it is just to retry a couple of times. A first attempt is performed immediately, the second after 2 seconds, the third 4 seconds after that, the fourth 8 seconds after the third and the fifth 16 seconds after the fourth.

@amisevsk
Copy link
Contributor

I've seen this problem when just trying to use minishift in general; the time between a project being 'deleted' as in removed from visible projects to when all resources in the project are cleaned up can be significant.

@sleshchenko
Copy link
Member

sleshchenko commented May 30, 2019

One comment:

The way to fix it is just to retry a couple of times. A first attempt is performed immediately, the second after 2 seconds, the third 4 seconds after that, the fourth 8 seconds after the third and the fifth 16 seconds after the fourth.

Is it needed to increase waiting time between attempts? Maybe it would be more clear and simpler like wait for delete project 1 minute (check every few seconds 2-5).
I just wonder what is a probability that namespace will be removed during first tries? I assume quite small. Then in most of cases script will wait 16 seconds without any check even if a namespace is already removed? Waiting time can be smaller and the cost of it - one request per few seconds, which I believe won't hurt any OS installation or desktop.

This ensures we don't wait unnecessarily long time at the later attempts
where it is actually more likely that the attempt will (finally) succeed.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
…le-attempts

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@metlos
Copy link
Contributor Author

metlos commented May 31, 2019

ci-build

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.

None yet

5 participants