rate_limit_except_level is broken in log.py

Bug #1946496 reported by Jonathan Mills
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo.log
Fix Released
High
Takashi Kajinami

Bug Description

In _options.py, you provide a config option called 'rate_limit_except_level', in line 202:

    202 cfg.StrOpt('rate_limit_except_level',
    203 default='CRITICAL',
    204 help='Log level name used by rate limiting: CRITICAL, ERROR, '
    205 'INFO, WARNING, DEBUG or empty string. Logs with level '
    206 'greater or equal to rate_limit_except_level are not '
    207 'filtered. An empty string means that all levels are '
    208 'filtered.'),
    209 ]

But then, over in log.py, when you try to parse this option, you call it by the wrong name in line 453:

    453 if conf.rate_limit_burst >= 1 and conf.rate_limit_interval >= 1:
    454 from oslo_log import rate_limit
    455 rate_limit.install_filter(conf.rate_limit_burst,
    456 conf.rate_limit_interval,
    457 conf.rate_limit_except)

You see the difference between 'rate_limit_except_level' vs 'rate_limit_except'

I am attaching a simple patch

Revision history for this message
Jonathan Mills (jonmills-t) wrote :
Revision history for this message
Jonathan Mills (jonmills-t) wrote :

I should have added...if this isn't patched, and you include the 'rate_limit_except_level' option in nova.conf, then none of your nova services will even start...

Revision history for this message
Olaf Seibert (oseibert-sys11) wrote :

The line number in the current main branch version seems to be 457:
https://opendev.org/openstack/oslo.log/src/branch/master/oslo_log/log.py#L457

Revision history for this message
Olaf Seibert (oseibert-sys11) wrote :

This bug will (also) hit you if you try to use the options `rate_limit_interval` or `rate_limit_burst`.

Changed in oslo.log:
importance: Undecided → High
status: New → Confirmed
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/oslo.log/+/914787

Changed in oslo.log:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.log (master)

Reviewed: https://review.opendev.org/c/openstack/oslo.log/+/914787
Committed: https://opendev.org/openstack/oslo.log/commit/4bd77b692370dcaebab18110cd4bf50e15346584
Submitter: "Zuul (22348)"
Branch: master

commit 4bd77b692370dcaebab18110cd4bf50e15346584
Author: Takashi Kajinami <email address hidden>
Date: Sun Mar 31 00:44:41 2024 +0900

    Fix broken reference to rate_limit_except_level

    Closes-Bug: #1946496
    Co-Authored-By: Jonathan Mills <email address hidden>
    Change-Id: If7439d111c66d00a2e4cb7425f48d3d501e5a124

Changed in oslo.log:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (stable/2024.1)

Fix proposed to branch: stable/2024.1
Review: https://review.opendev.org/c/openstack/oslo.log/+/915158

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/oslo.log/+/915400

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.log (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/oslo.log/+/915158
Committed: https://opendev.org/openstack/oslo.log/commit/1717f3970ecef6f33f1a83941e3b6e5f50ef4446
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit 1717f3970ecef6f33f1a83941e3b6e5f50ef4446
Author: Takashi Kajinami <email address hidden>
Date: Sun Mar 31 00:44:41 2024 +0900

    Fix broken reference to rate_limit_except_level

    Closes-Bug: #1946496
    Co-Authored-By: Jonathan Mills <email address hidden>
    Change-Id: If7439d111c66d00a2e4cb7425f48d3d501e5a124
    (cherry picked from commit 4bd77b692370dcaebab18110cd4bf50e15346584)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.