subscription-manager icon indicating copy to clipboard operation
subscription-manager copied to clipboard

2093883: Fix issue with race condition in rhsm.service

Open jirihnidek opened this issue 3 years ago • 1 comments

  • 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 changed rhsm.conf and [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.

jirihnidek avatar Oct 24 '22 15:10 jirihnidek

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

jirihnidek avatar Oct 24 '22 16:10 jirihnidek

Waiting on feedback from Anaconda team.

jirihnidek avatar Oct 26 '22 07:10 jirihnidek

This is ready for review now.

jirihnidek avatar Mar 15 '23 13:03 jirihnidek

It needs to be rebased to pick up new and updated CI bits.

ptoscano avatar Mar 15 '23 13:03 ptoscano

Coverage

Coverage (computed on Fedora latest) •
FileStmtsMissCoverMissing
rhsmlib/dbus/objects
   config.py1074062%52–53, 85, 99–100, 105–108, 128–130, 132, 134, 136–137, 139–140, 144, 146–147, 152, 155, 158–160, 165–168, 171, 228, 232, 235, 237–241, 243
TOTAL18074440675% 

Tests Skipped Failures Errors Time
2621 5 :zzz: 0 :x: 0 :fire: 55.218s :stopwatch:

github-actions[bot] avatar Mar 16 '23 20:03 github-actions[bot]