Bug 1322201

Summary: virt-who hasn't handle RateLimitExceededException when work at kvm/vdsm mode
Product: Red Hat Enterprise Linux 6 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Chris Snyder <csnyder>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: ldai, rbalakri, sgao, thozza, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.18-1.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 10:29:54 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:
Bug Depends On:    
Bug Blocks: 1269194, 1355878    

Description Liushihui 2016-03-30 01:54:58 UTC
Description of problem:
When virt-who received 429 info from candlepin, it will show "RateLimitExceededException" in the log.

Version-Release number of selected component (if applicable):
virt-who-0.16-7.el6.noarch 
subscription-manager-1.16.8-7.el6.x86_64 
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register system to stage candlepin.
2. Configure virt-who run at kvm/vdsm mode, start virt-who service, update host/guest mapping info frequently(start/stop/pause/add/delete)guests. make virt-who receive 429 info from server.
3. Check virt-who's log
# tail -f /var/log/rhsm/rhsm.log
MainProcess(13994):MainThread @virtwho.py:send:216 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 197, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 222, in _sendGuestList
    manager.sendVirtGuests(report, self.options)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 152, in sendVirtGuests
    self.connection.updateConsumer(self.uuid(), guest_uuids=serialized_guests)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 995, in updateConsumer
    ret = self.conn.request_put(method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 690, in request_put
    return self._request("PUT", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 598, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 664, in validateResponse
    raise RateLimitExceededException(response['status'])
RateLimitExceededException
2016-03-22 20:51:08,359 [virtwho.main DEBUG] MainProcess(13994):MainThread @virtwho.py:send_report:168 - Report from "env/cmdline" failed to sent.

Actual results:
Virt-who will show RateLimitExceededException in the log when it received 429 info.

Expected results:
Virt-who shouldn't show RateLimitExceededException when it received 429 info, it should show remind info to retry after 60s, just as work at esx mode.

Additional info:

Comment 1 Radek Novacek 2016-03-31 12:03:43 UTC
There is missing error handler, fixed upstream:

https://github.com/virt-who/virt-who/commit/d834d8df9cffde489a7d5a2c92f5ac33ad698b5b

Proposing for blocker.

Comment 2 Radek Novacek 2016-04-07 05:57:05 UTC
As I didn't manage to get this fixed in Snap4 and I don't want to risk breaking something in the RC, I'm moving this to 6.9. Sorry for troubles.

Comment 4 Radek Novacek 2016-10-11 14:04:16 UTC
Fixed in virt-who-0.18-1.el6.

Comment 6 Eko 2016-12-07 02:54:33 UTC
verified in virt-who-0.18-1.el6

if received 429 error code, virt-who will try to sent it again every 60s/120s/180s

Comment 8 errata-xmlrpc 2017-03-21 10:29:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0675.html