Bug 695707

Summary: repo delete doesn't not cancel ongoing sync
Product: [Retired] Pulp Reporter: dgao
Component: z_otherAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: dgao
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: cperry, mmccune, pthomas, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 23   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:06:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 647488, 684061, 697956    

Description dgao 2011-04-12 13:36:05 UTC
[root@pulp-qe-sandbox httpd]# pulp-admin repo create --id=foo --feed=yum:http://download.devel.redhat.com/released/RHEL-6/6.0/Server/x86_64/os/
Successfully created repository [ foo ]

[root@pulp-qe-sandbox httpd]# pulp-admin repo sync --id=foo
Sync for repository foo started
Use "repo status" to check on the progress

[root@pulp-qe-sandbox httpd]# pulp-admin repo status --id=foo
+------------------------------------------+
               Status for foo
+------------------------------------------+
Repository: foo
Number of Packages: 0
Last Sync: never
Currently syncing: 0% done (50 of 3397 packages downloaded)

[root@pulp-qe-sandbox httpd]# pulp-admin repo delete --id=foo
Successful deleted repository [ foo ]

[root@pulp-qe-sandbox httpd]# pulp-admin repo status --id=foo
error: operation failed: No repository foo


NetHogs version 0.7.0

  PID USER     PROGRAM                      DEV        SENT      RECEIVED       
7459  apache   (wsgi:pulp)                  eth0      23.749    1154.547 KB/sec
...

Comment 1 dgao 2011-04-12 13:37:23 UTC
To further verify that the sync is not stopped after repo delete, we can tail the grinder log to see the fetching of content.

Comment 2 Sayli Karmarkar 2011-04-14 22:51:00 UTC
$ sudo pulp-admin repo delete --id=foo
Repo [ foo ] cannot be deleted because of sync in progress. You can cancel ongoing sync using 'repo cancel_sync' command.

Comment 3 dgao 2011-04-15 14:48:06 UTC
[root@pulp-nightly httpd]# pulp-admin repo create --id=foo --feed=yum:http://download.devel.redhat.com/released/F-14/GOLD/Fedora/x86_64/os/
Successfully created repository [ foo ]

[root@pulp-nightly httpd]# pulp-admin repo sync --id=foo -F
Sync for repository foo started
Step: Downloading Items or Verifying
[                         ] 0%
Tree_Files: 0/7
Rpms: 36/2766
Total: 36/2773 items
^C

[root@pulp-nightly httpd]# pulp-admin repo delete --id=foo
Repo [ foo ] cannot be deleted because of sync in progress. You can cancel ongoing sync using 'repo cancel_sync' command.
[root@pulp-nightly httpd]# pulp-admin repo cancel_sync --id=foo
Sync for repository foo canceled

[root@pulp-nightly httpd]# pulp-admin repo delete --id=foo
Repo [ foo ] cannot be deleted because of sync in progress. You can cancel ongoing sync using 'repo cancel_sync' command.

Nethogs show no activity after cancel_sync..but we still can't remove the repo.

Comment 4 Sayli Karmarkar 2011-04-21 08:44:09 UTC
I am reverting initial fix for this bug to move it from client to server side. Server side changes are causing a lot of api tests to break as lot of our api tests are not waiting for repo syncs to finish before deleting repos. I am working on fixing these api tests and server side fix.

Comment 5 Sayli Karmarkar 2011-04-28 16:24:55 UTC
Fixed in server side api.

Comment 6 Jeff Ortel 2011-05-04 15:41:51 UTC
build: 0.173

Comment 7 dgao 2011-05-10 19:33:34 UTC
[root@pulp-nightly pulp]# pulp-admin repo create --id=foo --feed=yum:http://download.devel.redhat.com/released/RHEL-6/6.0/Server/x86_64/os/
Successfully created repository [ foo ]

[root@pulp-nightly pulp]# pulp-admin repo sync --id=foo
Sync for repository foo started
Use "repo status" to check on the progress
[root@pulp-nightly pulp]# pulp-admin repo sync --id=foo -F
Sync for repository foo already in progress
Step: Downloading Items or Verifying
[                         ] 1%
Tree_Files: 0/6
Rpms: 159/3391
Total: 159/3397 items
^C

[root@pulp-nightly pulp]# pulp-admin repo delete --id=foo
error: operation failed: PulpException: "Repo cannot be deleted because of sync in progress. You can cancel ongoing sync using 'repo cancel_sync' command."
[root@pulp-nightly pulp]# pulp-admin repo cancel_sync --id=foo
Sync for repository foo canceled

[root@pulp-nightly pulp]# pulp-admin repo delete --id=foo
Successful deleted repository [ foo ]

Comment 8 Preethi Thomas 2011-08-16 12:06:18 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 9 Preethi Thomas 2011-08-16 12:20:30 UTC
Closing with Community Release 15

pulp-0.0.223-4.