Bug 1313688

Summary: [RFE] Project deletion is asynchronous
Product: OpenShift Container Platform Reporter: Alexander Koksharov <akokshar>
Component: MasterAssignee: Jordan Liggitt <jliggitt>
Status: CLOSED WONTFIX QA Contact: weiwei jiang <wjiang>
Severity: low Docs Contact:
Priority: medium    
Version: 3.1.0CC: aos-bugs, jokerman, mmccomas, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-24 15:29:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 2 Alexander Koksharov 2016-03-02 09:00:05 UTC
Description of problem:
Whenever project is deleted via the CLI, system instantaneously returns a message stating that the project has been deleted.
However, the project has only started being deleted. This will make any scripts that delete/remake projects very unreliable.

Version-Release number of selected component (if applicable):
OSE 3.1.1

How reproducible:
execute twice the next command:
oc new-project trash;oc delete project trash;oc new-project trash

Steps to Reproduce:
1.
2.
3.

Actual results:

root@master # oc new-project trash;oc delete project trash;oc new-project trash
Now using project "trash" on server "https://master.ose3.test:8443".

You can add applications to this project with the 'new-app' command. For example, try:

    $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

to build a new hello-world application in Ruby.
project "trash" deleted
Now using project "trash" on server "https://master.ose3.test:8443".

You can add applications to this project with the 'new-app' command. For example, try:

    $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

to build a new hello-world application in Ruby.

[02/03 09:41:11][~]
root@master # oc new-project trash;oc delete project trash;oc new-project trash
Error from server: project "trash" already exists
project "trash" deleted
Error from server: project "trash" already exists

[02/03 09:41:26][~]
root@master # 


Expected results:


Additional info:

Comment 3 Jordan Liggitt 2016-04-13 22:21:07 UTC
API calls are not designed to be long running. Processes that need to wait until project cleanup is complete can watch or poll until the project no longer is in the Terminating state and is deleted.

Comment 4 Jordan Liggitt 2016-04-13 22:22:24 UTC
All deletion is potentially asynchronous (for example, by default, pod deletion waits for nodes to send kill signals to pod processes and for them to exit gracefully)

Comment 5 weiwei jiang 2016-04-14 01:53:26 UTC
(In reply to Jordan Liggitt from comment #4)
> All deletion is potentially asynchronous (for example, by default, pod
> deletion waits for nodes to send kill signals to pod processes and for them
> to exit gracefully)

Or can we delete the kubernetes related resources firstly?

I saw we first delete our openshift resources(policy bindings), and this will make project invisible for users to let user think the project have already been deleted, maybe the project will be deleted after several seconds actually.

We have report a bug about this https://bugzilla.redhat.com/show_bug.cgi?id=1324465, but the solution still can not make user create the same name project after the project is invisible.

Comment 6 Jordan Liggitt 2016-04-14 02:22:19 UTC
Deletion order should not be counted on. Multiple workers can be spawned to delete resources in parallel.