Bug 712366

Summary: Canceling a restored sync task does not work
Product: [Retired] Pulp Reporter: John Matthews <jmatthew>
Component: z_otherAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dgao
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 24   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 14:02:20 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: 641987    

Description John Matthews 2011-06-10 12:48:25 UTC
Description of problem:
Cancel sync is not working on a restored task.  I noticed that the 'self.synchronizers' for RepoSyncTask is None.

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

How reproducible:
Always

Steps to Reproduce:
1. Sync a repo
2. While sync is in progress kill apache
3. Start apache
4. Perform a repo list (or some operation so previous sync task is kicked off)
5. Verify in logs sync is now running
6. Execute a 'cancel_sync'.  

  
Actual results:
Observe with 'sudo nethogs' that mod_wsgi is still downloading and sync has not been canceled

Expected results:
Sync would be canceled.

Additional info:

Comment 1 John Matthews 2011-06-13 17:08:38 UTC
Fixed in this commit: a633edb36afeab3036150d5a0888f708e3707df4

Comment 2 Jeff Ortel 2011-06-13 19:48:11 UTC
build: 0.190

Comment 3 dgao 2011-06-16 13:48:34 UTC
[root@pulp-qe ~]# pulp-admin repo create --id=foo --feed=http://download.devel.redhat.com/released/RHEL-6/6.0/Server/x86_64/os/
Successfully created repository [ foo ]

[root@pulp-qe ~]# pulp-admin repo sync --id=foo -F
Sync for repository foo started
You can safely CTRL+C this current command and it will continue
Waiting /
Step: Downloading Metadata
Waiting -
.
.
.
Step: Downloading Items or Verifying
[                         ] 0%
Tree_Files: 0/6
Rpms: 12/3391
Total: 12/3397 items

Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 189, in <module>
    admin.main()
  File "/usr/lib/python2.7/site-packages/pulp/client/cli/base.py", line 117, in main
    command.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/core/base.py", line 116, in main
    action.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/core/base.py", line 204, in main
    self.run()
  File "/usr/lib/python2.7/site-packages/pulp/client/core/repo.py", line 835, in run
    self.sync_foreground(task)
  File "/usr/lib/python2.7/site-packages/pulp/client/core/repo.py", line 797, in sync_foreground
    task = self.repository_api.task_status(task['status_path'])
  File "/usr/lib/python2.7/site-packages/pulp/client/api/base.py", line 34, in task_status
    return self.server.GET(str(status_path))[1]
  File "/usr/lib/python2.7/site-packages/pulp/client/server.py", line 295, in GET
    return self._request('GET', path, queries)
  File "/usr/lib/python2.7/site-packages/pulp/client/server.py", line 252, in _request
    connection.request(method, url, body=body, headers=self.headers)
  File "/usr/lib64/python2.7/httplib.py", line 946, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 987, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 940, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 803, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/httplib.py", line 755, in send
    self.connect()
  File "/usr/lib64/python2.7/site-packages/M2Crypto/httpslib.py", line 50, in connect
    self.sock.connect((self.host, self.port))
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 185, in connect
    ret = self.connect_ssl()
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 178, in connect_ssl
    return m2.ssl_connect(self.ssl, self._timeout)
M2Crypto.SSL.SSLError: (104, 'Connection reset by peer')

-----------apache is stopped---------------

-----------apache is started---------------


[root@pulp-qe ~]# pulp-admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                      foo                      
Name                    foo                      
Feed URL                http://download.devel.redhat.com/released/RHEL-6/6.0/Server/x86_64/os/
Feed Type               remote                   
Feed Certs              CA:No   Cert:No
Consumer Certs          CA:No   Cert:No
Architecture            noarch                   
Sync Schedule           None                     
Packages                0                        
Files                   0                        
Distributions           None                     
Publish                 True                     
Clones                  []                       
Groups                  None                     
Filters                 []                       
Notes                   {}                       

[root@pulp-qe ~]# pulp-admin repo cancel_sync --id=foo 
Sync for repository foo is being canceled

[root@pulp-qe ~]# nethogs 

9238  qpidd    /usr/sbin/qpidd              eth0       0.143       0.198 KB/sec

Comment 4 Preethi Thomas 2011-08-16 14:02:20 UTC
Closing with Community Release 15

pulp-0.0.223-4.