Bug 1644342 - Possible race of concurrent Actions::Katello::Host::Update tasks from rhsmcertd-worker and virt-who
Summary: Possible race of concurrent Actions::Katello::Host::Update tasks from rhsmcer...
Keywords:
Status: CLOSED DUPLICATE of bug 1643649
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-30 15:12 UTC by Pavel Moravec
Modified: 2018-10-30 15:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 15:57:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3671011 0 None None None 2018-10-30 15:48:48 UTC

Description Pavel Moravec 2018-10-30 15:12:31 UTC
Description of problem:
In case a hypervisor is registered as a Host and is running virt-who, a task to update the Host can fail on acquired lock. The reason is, both rhsmcertd-worker AND virt-who can fire "PUT /rhsm/consumers/${UUID}" requests concurrently and independently, what leads to concurrent Actions::Katello::Host::Update tasks where either of them fails with "Required lock is already taken by other running tasks" error.

We should handle this better in our API, that e.g. should handle the 2nd request, wait till the 1st is completed and then continue in the 2nd one.


Version-Release number of selected component (if applicable):
Sat 6.3, expected in 6.4 as well.


How reproducible:
100% with some effort / proper timing


Steps to Reproduce:
1. Have a hypervisor registered as a Host, with virt-who installed & configured
2. Populate or update some host's facts, just to have Host update crunching the facts longer.
3. Enable rhsm debugs and restart rhsmcertd service
4. Check rhsm logs to spot time when "PUT /rhsm/consumers/${UUID}" is triggered.
5. At that time, run virt-who -o.
6. After a while, check for status of 2 Host update tasks  for this Host.


Actual results:
2nd Host update fails with "Required lock is already taken by other running tasks" error.


Expected results:
2nd Host update task proceeds well.


Additional info:

Comment 1 Mike McCune 2018-10-30 15:57:17 UTC
We are tracking this in: 1643649

going to close this as a dupe.

*** This bug has been marked as a duplicate of bug 1643649 ***


Note You need to log in before you can comment on or make changes to this bug.