Bug 950772

Summary: Now that the pycurl downloader supports it, the ISO Importer should be updated for cancellation support
Product: [Retired] Pulp Reporter: Randy Barlow <rbarlow>
Component: iso-supportAssignee: Randy Barlow <rbarlow>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: MasterCC: jason.dobies, pthomas
Target Milestone: ---Keywords: Triaged
Target Release: 2.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-09 14:36:58 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:
Embargoed:

Description Randy Barlow 2013-04-10 20:41:05 UTC
Cancellation support was removed from the ISOImporter when it was migrated to using the pycurl downloader, since at the time it didn't support cancellation. Now that the pycurl downloader supports the cancel call again, we should re-enable cancellation in the ISOImporter.

Comment 1 Randy Barlow 2013-05-07 18:16:41 UTC
https://github.com/pulp/pulp_rpm/pull/194

Comment 2 Jeff Ortel 2013-06-04 15:54:42 UTC
build: 2.2.0-0.1.beta

Comment 3 Preethi Thomas 2013-06-07 14:16:32 UTC
Fails-qa
[root@hp-dl360g6-01 ~]# rpm -q pulp-server
pulp-server-2.2.0-0.2.beta.fc18.noarch
[root@hp-dl360g6-01 ~]# 

It does cancel, but see this in pulp.log


2013-06-07 10:14:31,537 pulp.server.managers.repo.sync:ERROR: Exception caught from plugin during sync for repo [rhel-iso]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/sync.py", line 155, in _do_sync
    sync_report = importer_instance.sync_repo(transfer_repo, conduit, call_config)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso_importer/importer.py", line 111, in sync_repo
    report = self.iso_sync.perform_sync()
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso_importer/sync.py", line 170, in perform_sync
    self.progress_report.state = self.progress_report.STATE_COMPLETE
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/progress.py", line 293, in _set_state
    super(self.__class__, self)._set_state(new_state)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/progress.py", line 165, in _set_state
    if new_state not in self.ALLOWED_STATE_TRANSITIONS[self._state]:
KeyError: 'cancelled'
2013-06-07 10:14:31,545 pulp.server.dispatch.task:ERROR: Pulp exception occurred: PulpExecutionException
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/dispatch/task.py", line 138, in _run
    result = call(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/sync.py", line 111, in sync
    sync_result = self._do_sync(repo, importer_instance, transfer_repo, conduit, call_config)
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/sync.py", line 155, in _do_sync
    sync_report = importer_instance.sync_repo(transfer_repo, conduit, call_config)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso_importer/importer.py", line 111, in sync_repo
    report = self.iso_sync.perform_sync()
  File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/iso_importer/sync.py", line 170, in perform_sync
    self.progress_report.state = self.progress_report.STATE_COMPLETE
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/progress.py", line 293, in _set_state
    super(self.__class__, self)._set_state(new_state)
  File "/usr/lib/python2.7/site-packages/pulp_rpm/common/progress.py", line 165, in _set_state
    if new_state not in self.ALLOWED_STATE_TRANSITIONS[self._state]:
PulpExecutionException: Pulp exception occurred: PulpExecutionException

Comment 4 Randy Barlow 2013-06-11 15:11:57 UTC
I corrected that traceback in https://github.com/pulp/pulp_rpm/pull/240

Comment 5 Jay Dobies 2013-06-12 14:03:16 UTC
*** Bug 973313 has been marked as a duplicate of this bug. ***

Comment 6 Randy Barlow 2013-06-21 15:19:38 UTC
This is merged to our 2.2.1 branch, and to master.

Comment 7 Jeff Ortel 2013-11-01 18:50:26 UTC
build: 2.2.1-0.1.beta

Comment 8 Preethi Thomas 2013-11-08 18:26:32 UTC
verified

[root@pulp-v2-server ~]# rpm -qa pulp-server
pulp-server-2.2.2-1.el6.noarch
[root@pulp-v2-server ~]# 

[root@pulp-v2-server ~]# pulp-admin iso repo sync run --repo-id cdn-iso 
+----------------------------------------------------------------------+
                   Synchronizing Repository [cdn-iso]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading the Pulp Manifest...
The Pulp Manifest was downloaded successfully.

Downloading 5 ISOs...
[                                                  ] 0%
ISOs: 2/5	Data: 14.3 MB/10.2 GB	Avg: 471.0 kB/s


Failed to retrieve 3 ISOs.

The download was cancelled.

[root@pulp-v2-server ~]#

Comment 9 Preethi Thomas 2013-12-09 14:36:58 UTC
Released pulp 2.2.1