Skip to content

[Backport v4.3-branch] logging: fix starvation caused by uncommitted message#107141

Open
github-actions[bot] wants to merge 1 commit intov4.3-branchfrom
backport-106908-to-v4.3-branch
Open

[Backport v4.3-branch] logging: fix starvation caused by uncommitted message#107141
github-actions[bot] wants to merge 1 commit intov4.3-branchfrom
backport-106908-to-v4.3-branch

Conversation

@github-actions
Copy link
Copy Markdown

@github-actions github-actions bot commented Apr 11, 2026

Backport 5184eac from #106908.

Fixes #101401

Fix a scenario where the logging thread can enter an infinite
loop and starve lower-priority threads when encountering an
uncommitted log message.

If a lower-priority thread is preempted before committing a
message, and a higher-priority thread triggers log processing,
the logging thread may repeatedly attempt to claim it. Since the
message is pending but not committed, z_log_msg_claim() returns
NULL while z_log_msg_pending() remains true, resulting in a
livelock.

Update the log processing logic to avoid looping on uncommitted
messages, allowing lower-priority threads to resume and complete
the commit.

Fixes #101401

Signed-off-by: Javier Romera <lromerajdev@gmail.com>
(cherry picked from commit 5184eac)
@github-actions github-actions bot added the Backport Backport PR and backport failure issues label Apr 11, 2026
@github-project-automation github-project-automation bot moved this to To do in Backports Apr 11, 2026
@sonarqubecloud
Copy link
Copy Markdown

@jhedberg jhedberg requested a review from nordic-krch April 20, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Backport PR and backport failure issues

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

2 participants