Skip to content

[202512][syslog]: Wait for rate-limit notification forwarding - #1382

Merged
bingwang-ms merged 1 commit into
Azure:202512from
deerao02:deerao/msft-backport-27402-202512
Aug 27, 2026
Merged

[202512][syslog]: Wait for rate-limit notification forwarding#1382
bingwang-ms merged 1 commit into
Azure:202512from
deerao02:deerao/msft-backport-27402-202512

Conversation

@deerao02

Copy link
Copy Markdown

Description of PR

Summary:
Backport sonic-net/sonic-mgmt#27402 to replace the fixed forwarding delay in
the 202512 syslog rate-limit test with a marker-scoped wait for the
rate-limit notification.

Reference: sonic-net/sonic-mgmt#27402

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

  • 202512: SONiC.20251210.12 -
    tests/syslog/test_syslog_rate_limit.py::test_syslog_rate_limit passed on
    vms13-lt2-nh4210-1 (lt2-u32d128): 1 passed in 412.59s.

Approach

What is the motivation for this PR?

The log generator runs inside a container, and rsyslog forwards its
rate-limit notification to the host asynchronously. The existing fixed
five-second delay can expire before the notification arrives, causing the
presence analyzer to report expected_missing_match: 1 even though rate
limiting worked.

How did you do it?

Replaced the fixed delay with a bounded poll of the marker-scoped host
syslog. The analyzer window remains open until every configured presence
pattern arrives or the existing 120-second forwarding timeout expires.

The cherry-pick conflict was resolved by retaining the 202512 analyzer
structure and adapting the polling behavior from sonic-net/sonic-mgmt#27402
to its existing presence_log_regex flow.

How did you verify/test it?

  • internal-202512, SONiC.20251210.12:
    tests/syslog/test_syslog_rate_limit.py::test_syslog_rate_limit passed on
    vms13-lt2-nh4210-1 (1 passed in 412.59s).
  • python3 -m py_compile tests/syslog/test_syslog_rate_limit.py
  • flake8 --max-line-length=120 tests/syslog/test_syslog_rate_limit.py
  • git diff --check

Any platform specific information?

Observed on an NH-4210 testbed under elevated log load, but the asynchronous
forwarding race is platform-independent.

Supported testbed topology if it's a new test case?

Not applicable.

Documentation

Not applicable.

The presence analyzer can race asynchronous notification forwarding because the existing poll waits only for generated messages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9ec7c542-26cb-4b5c-a5f4-4114276da6d3
(cherry picked from commit 4a8152ed479e1982a0f150273b538f055be94220)
Signed-off-by: Deeksha Rao <deerao@microsoft.com>

# Conflicts:
#	tests/syslog/test_syslog_rate_limit.py
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@bingwang-ms
bingwang-ms merged commit b4bfa0c into Azure:202512 Aug 27, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants