subscription-manager
subscription-manager copied to clipboard
2093883: Fix issue with race condition in rhsm.service
- BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2093883
- Card ID: ENT-5383
- When logging level was changed using D-Bus method
SetAll(), then exception was raised and it wasn't possible to change log level. This has happened very rarely. - The race condition was caused probably by this case. When logging level was changed by
SetAll()method and it was necessary to re-initialized logging, then some other process changedrhsm.confand [logging] section was removed from this file. When iniparse tried to get section logging, then this section wasn't there and it caused exceptions. - Fixed same issue for
Set()D-Bus method too.
I would like to test it more with Anaconda team, because I wasn't able to reproduce the issue described in the BZ. I have created testing bash script, but it didn't help.
#!/bin/bash
export MAX=10
export counter=0
while [[ $counter -lt $MAX ]]; do
echo ${counter}
# Change configuraton using SetAll() method
dbus-send --system --print-reply --dest=com.redhat.RHSM1 \
/com/redhat/RHSM1/Config com.redhat.RHSM1.Config.SetAll \
dict:string:string:"logging.default_log_level","DEBUG" string:"" &
sleep 0.1
# Comment loggin section
sed -i "s/^\[logging\]/\#\[logging\]/" /etc/rhsm/rhsm.conf
sed -i "s/^default_log_level/\#default_log_level/" /etc/rhsm/rhsm.conf
counter=`expr ${counter} + 1`
done
Waiting on feedback from Anaconda team.
This is ready for review now.
It needs to be rebased to pick up new and updated CI bits.
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 2621 | 5 :zzz: | 0 :x: | 0 :fire: | 55.218s :stopwatch: |