Description of problem: If you cancel a repo sync, the "main" sync thread gets interrupted, but because the sync is itself threaded, the spawned child threads continue to pull in packages. How reproducible: Sync a repo through the web services and then cancel the sync and watch the progress updates Steps to Reproduce: 1. sync repo 2. cancel sync 3. watch progress updates Actual results: repo continues to sync Expected results: repo sync stops completely Additional info: This is such a bummer...
Grinder has a 'stop' method that will tell all spawned threads to stop after they've finished the package they are downloading. YumRepoGrinder.stop() is the method to invoke for 'yum' feeds. RHNSync.stop() is the method to invoke for 'rhn' feeds.
monkey patched paython's stdlib threading module in order to track thread hierarchy and cancel not only a task's thread, but any child threads it may have spawned.
fails_qa [root@preethi pulp]# rpm -qa |grep pulp pulp-0.0.61-1.fc13.noarch pulp-client-0.0.61-1.fc13.noarch pulp-common-0.0.61-1.fc13.noarch You have new mail in /var/spool/mail/root [root@preethi pulp]# rpm -qa |grep grinder grinder-0.0.60-1.fc13.noarch I ran repo sync in one terminal window and while its running I cancelled the sync from another terminal window. Even though I got the cancelled sync message ,the sync continued and finished successfully. root@preethi ~]# pulp-admin repo cancel_sync --id=f13 --taskid=58211bd7-bf60-11df-a0a9-002564a85a58 Sync task 58211bd7-bf60-11df-a0a9-002564a85a58 cancelled [root@preethi pulp]# pulp-admin repo sync --id=f13 Task created with ID:: 58211bd7-bf60-11df-a0a9-002564a85a58 Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: finished Sync Successful. Repo [ f13 ] now has a total of [ 3102 ] packages
Fixed another bug that was introduced by using weak references. This should be (again) fixed.
fails_qa I started a sync for a repo, and while it was running, I did a cancel_sync for that repo. I got the sync task cancelled message but the actual sync continued and finised. [root@preethi ~]# pulp-admin -u admin -p admin repo sync --id=f13 Task created with ID:: ac84bf0c-c1ab-11df-804b-002564a85a58 Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: running Sync Status:: finished Sync Successful. Repo [ f13 ] now has a total of [ 3102 ] packages You have new mail in /var/spool/mail/root [root@preethi ~]# pulp-admin -u admin -p admin repo cancel_sync --id=f13 --taskid=ac84bf0c-c1ab-11df-804b-002564a85a58 Sync task ac84bf0c-c1ab-11df-804b-002564a85a58 cancelled You have new mail in /var/spool/mail/root
Fixed in build 0.76.
verified [root@preethi ~]# pulp-admin repo status --id=f13 +------------------------------------------+ Status for f13 +------------------------------------------+ Repository: f13 Number of Packages: 3102 Last Sync: 2010-10-27 11:57:16.131000 [root@preethi ~]# [root@preethi ~]# [root@preethi ~]# pulp-admin repo sync --id=f13 -F Sync for repository f13 started You can safely CTRL+C this current command and it will continue [== ] 5% (181 of 3111 pkgs) Sync: Canceled [root@preethi ~]# pulp-admin repo status --id=f13 +------------------------------------------+ Status for f13 +------------------------------------------+ Repository: f13 Number of Packages: 3102 Last Sync: 2010-10-27 11:57:16.131000 [root@preethi ~]# [root@preethi ~]# [root@preethi ~]# pulp-admin repo cancel_sync --id=f13 Sync for repository f13 canceled
Closing with Community Release 15 pulp-0.0.223-4.