RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2060138 - Regression: TuneD fails to parse inline comments
Summary: Regression: TuneD fails to parse inline comments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: tuned
Version: 8.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL:
Whiteboard:
Depends On:
Blocks: 2059934
TreeView+ depends on / blocked
 
Reported: 2022-03-02 19:34 UTC by Jiří Mencák
Modified: 2022-11-08 12:44 UTC (History)
3 users (show)

Fixed In Version: tuned-2.19.0-0.1.rc1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 10:52:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-114273 0 None None None 2022-03-02 19:37:56 UTC
Red Hat Product Errata RHBA-2022:7747 0 None None None 2022-11-08 10:52:51 UTC

Description Jiří Mencák 2022-03-02 19:34:22 UTC
Description of problem:
TuneD 2.18.0+ fails to parse inline comments properly.  An example of TuneD configuration file that poses issues for the parser:

[main]
summary=PoC

[cpu]
governor=performance                            # This is a comment

[service]
service.stalld=start,enable                     # This is a comment

[vm]
transparent_hugepages=never                     # This is a comment

[selinux]
avc_cache_threshold=8192                        # This is a comment

[net]
nf_conntrack_hashsize=131072                    # This is a comment

How reproducible:
Always


Actual results:
2022-03-02 14:29:27,274 INFO     tuned.daemon.application: TuneD: 2.18.0, kernel: 4.18.0-240.el8.x86_64
2022-03-02 14:29:27,274 INFO     tuned.daemon.application: dynamic tuning is globally disabled
2022-03-02 14:29:27,278 INFO     tuned.daemon.daemon: using sleep interval of 1 second(s)
2022-03-02 14:29:27,278 INFO     tuned.daemon.daemon: Running in automatic mode, checking what profile is recommended for your configuration.
2022-03-02 14:29:27,279 INFO     tuned.daemon.daemon: Using 'bz' profile
2022-03-02 14:29:27,280 INFO     tuned.profiles.loader: loading profile: bz
2022-03-02 14:29:27,281 INFO     tuned.daemon.controller: starting controller
2022-03-02 14:29:27,281 INFO     tuned.daemon.daemon: starting tuning
2022-03-02 14:29:27,303 INFO     tuned.plugins.base: instance cpu: assigning devices cpu0, cpu1
2022-03-02 14:29:27,307 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2022-03-02 14:29:27,309 WARNING  tuned.plugins.plugin_cpu: your CPU doesn't support MSR_IA32_ENERGY_PERF_BIAS, ignoring CPU energy performance bias
2022-03-02 14:29:27,310 ERROR    tuned.plugins.plugin_service: service 'stalld': invalid service option: 'enable                        # This is a comment'
2022-03-02 14:29:27,311 INFO     tuned.plugins.base: instance net: assigning devices eth0
2022-03-02 14:29:27,382 WARNING  tuned.plugins.plugin_vm: Incorrect 'transparent_hugepages' value 'never                        # This is a comment'.
2022-03-02 14:29:27,383 ERROR    tuned.units.manager: BUG: Unhandled exception in start_tuning: invalid literal for int() with base 10: '8192\t\t\t# This is a comment'
2022-03-02 14:29:27,383 ERROR    tuned.units.manager: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tuned/units/manager.py", line 119, in _try_call
    return f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/instance/instance.py", line 78, in apply_tuning
    self._plugin.instance_apply_tuning(self)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 261, in instance_apply_tuning
    self._instance_apply_static(instance)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 317, in _instance_apply_static
    self._execute_all_non_device_commands(instance)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 433, in _execute_all_non_device_commands
    self._execute_non_device_command(instance, command, new_value)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 514, in _execute_non_device_command
    command["set"](new_value, sim = False)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/plugin_selinux.py", line 49, in _set_avc_cache_threshold
    threshold = int(value)
ValueError: invalid literal for int() with base 10: '8192\t\t\t# This is a comment'

2022-03-02 14:29:27,384 ERROR    tuned.utils.commands: Error when reading file '/sys/module/nf_conntrack/parameters/hashsize': '[Errno 2] No such file or directory: '/sys/module/nf_conntrack/parameters/hashsize''
2022-03-02 14:29:27,384 ERROR    tuned.units.manager: BUG: Unhandled exception in start_tuning: invalid literal for int() with base 10: '131072 \t\t\t# This is a comment'
2022-03-02 14:29:27,384 ERROR    tuned.units.manager: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tuned/units/manager.py", line 119, in _try_call
    return f(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/instance/instance.py", line 78, in apply_tuning
    self._plugin.instance_apply_tuning(self)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 261, in instance_apply_tuning
    self._instance_apply_static(instance)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 317, in _instance_apply_static
    self._execute_all_non_device_commands(instance)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 433, in _execute_all_non_device_commands
    self._execute_non_device_command(instance, command, new_value)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/base.py", line 514, in _execute_non_device_command
    command["set"](new_value, sim = False)
  File "/usr/lib/python3.6/site-packages/tuned/plugins/plugin_net.py", line 275, in _set_nf_conntrack_hashsize
    hashsize = int(value)
ValueError: invalid literal for int() with base 10: '131072 \t\t\t# This is a comment'


Expected results:
TuneD config file properly parsed with inline comments.


Additional info:
https://github.com/redhat-performance/tuned/pull/380

Comment 1 Jiří Mencák 2022-03-06 13:00:12 UTC
Linking upstream issue: https://github.com/redhat-performance/tuned/issues/378

The upstream issue (and this BZ) seems to be fixed by https://github.com/redhat-performance/tuned/pull/380
I've tested the PR on the config in https://bugzilla.redhat.com/show_bug.cgi?id=2060138#c0 and
all inline comments were parsed correctly.

Comment 2 Jaroslav Škarvada 2022-03-17 09:59:38 UTC
The fix is already merged upstream. We will try to target RHEL-8.7. The fix will be also included in FDP, it's tracked by bug 2064605.

Comment 10 errata-xmlrpc 2022-11-08 10:52:37 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 (tuned bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2022:7747


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