Skip to content

Fix extract_log crash on unparseable syslog lines from logrotate race#24114

Open
JibinBao wants to merge 1 commit intosonic-net:masterfrom
JibinBao:fix_extract_log
Open

Fix extract_log crash on unparseable syslog lines from logrotate race#24114
JibinBao wants to merge 1 commit intosonic-net:masterfrom
JibinBao:fix_extract_log

Conversation

@JibinBao
Copy link
Copy Markdown
Contributor

Description of PR

Print warning log so that lines with unparseable dates (e.g. split/truncated fragments caused by logrotate race conditions) are logged and skipped instead of crashing the entire LogAnalyzer teardown. When dt is None, set it to 0 to avoid exceptions during comparison.

Summary:
Fixes # (issue)

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

Approach

What is the motivation for this PR?

Print warning log so that lines with unparseable dates

How did you do it?

print it

How did you verify/test it?

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@github-actions github-actions Bot requested review from r12f, wangxin and xwjiang-ms April 22, 2026 03:29
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

    Replace the hard assert in convert_date() with a warning log so that
    lines with unparseable dates (e.g. split/truncated fragments caused by
    logrotate race conditions) are logged and skipped instead of crashing
    the entire LogAnalyzer teardown. When dt is None, set it to 0 to avoid exceptions during comparison.

Signed-off-by: jbao <jbao@nvidia.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

3 participants