Bug 1523254

Summary: Under Satellite high load 'subscription-manager --force' command on clients locks itself and fails
Product: Red Hat Satellite Reporter: anerurka
Component: RegistrationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.10CC: aruzicka, bbuckingham, dcaplan, inecas
Target Milestone: UnspecifiedKeywords: PrioBumpPM, Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-05 15:57:20 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:
Attachments:
Description Flags
register.png
none
unregister.png none

Description anerurka 2017-12-07 14:22:37 UTC
Created attachment 1364321 [details]
register.png

Description of problem:

Under Satellite high load 'subscription-manager --force' command on clients locks itself and fails


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

Satellite Server v.6.2.12


How reproducible:


Executed a 'satellite-manager register --force' on a satellite client:

[1 ] subscription-manager register --force --activationkey=xxxxx --org=xxxxx'

As expected [1] created an [2] unregister task followed by a [3] register task on Satellite, but the register task failed because it did not wait until the unregister task finish, so [1] failed on step [3] because step [2] was not finished:

[2][screenshot attached at unregister.png]
---------------------------------------------------
 Id: 20c63be7-60b7-4deb-ab9a-b088b75ffff6
Label: Actions::Katello::Host::Unregister
Name: Unregister Host
Owner: foreman_admin
Execution type: Delayed
Start at: 2017-11-30 08:03:38 UTC
Start before: -
Started at: 2017-11-30 08:03:38 UTC
Ended at: 2017-11-30 08:08:48 UTC
State: stopped
Result: success 
----------------------------------------------------------

[3][screenshot attached at register.png]
------------------------------------------------------------------
 Id: fd0cb4b9-d43f-42ad-ab83-b59c75121b92
Label: Actions::Katello::Host::Register
Name: Register Host
Owner: foreman_admin
Execution type: Delayed
Start at: 2017-11-30 08:05:38 UTC
Start before: -
Started at: 2017-11-30 08:05:38 UTC
Ended at: 2017-11-30 08:05:38 UTC
State: stopped
Result: error 

Required lock: read
Conflicts with tasks:
- https://satellite.example.com/foreman_tasks/tasks/20c63be7-60b7-4deb-ab9a-b088b75ffff6
Required lock is already taken by other running tasks.
Please inspect their state, fix their errors and resume them.

Actual results:

unregister task [2] started at 08:03:30 and finished 08:08:48 ( ~ 5 minutes before !), but the register task [3] started at 08:05:38 and failed because [2] did not finished. 
As can be seen  the register task [3] just wait 120s for the unregister task  [2] to finish, and then tries the register. 
As global result under this conditions  'subscription-manager --force' is locking itself if the unregister task [2] takes more than 120s.


Expected results:

register task should not be started until unregister task is completed.


Additional info:

Comment 1 anerurka 2017-12-07 14:23:22 UTC
Created attachment 1364322 [details]
unregister.png