Skip to content

RDKEMW-28136: Guard task executors against exceptions - #688

Closed
jaihere4u wants to merge 1 commit into
masterfrom
RDKEMW-28136-task-exception-guard
Closed

jaihere4u wants to merge 1 commit into
masterfrom
RDKEMW-28136-task-exception-guard

Conversation

@jaihere4u

Copy link
Copy Markdown

Reason for change:
None of the three task executors caught exceptions. A throwing task escaped the thread function and called std::terminate, killing the session-server process - and every session in it - with no error log. On the main thread a thrown exception also skipped the state->done signal, hanging any enqueueTaskAndWait waiter before termination.

MainThread::mainThreadLoop, WorkerThread::taskHandler and EventThread::threadExecutor now catch std::exception and unknown exceptions, log them, and continue the loop. On the main thread the state->done signal still runs after a failed task so waiters are released.

Test Procedure:
Enqueue a throwing task on each executor; verify the process survives, the exception is logged, and enqueueTaskAndWait callers are released. Existing unit tests pass.

Reason for change:
None of the three task executors caught exceptions. A throwing task escaped
the thread function and called std::terminate, killing the session-server
process - and every session in it - with no error log. On the main thread a
thrown exception also skipped the state->done signal, hanging any
enqueueTaskAndWait waiter before termination.

MainThread::mainThreadLoop, WorkerThread::taskHandler and
EventThread::threadExecutor now catch std::exception and unknown exceptions,
log them, and continue the loop. On the main thread the state->done signal
still runs after a failed task so waiters are released.

Test Procedure:
Enqueue a throwing task on each executor; verify the process survives, the
exception is logged, and enqueueTaskAndWait callers are released. Existing
unit tests pass.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 15:08
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Pull request title must follow the pattern:
< JIRA TICKET >: < one line summary of change less than 65 characters >

Pull request description must follow the Commit message format for RDK-E:
https://etwiki.sys.comcast.net/spaces/RDKAR/pages/1407997180/Commit+Message+Format+For+RDKE

  1. Associated JIRA ticket in format : < JIRA TICKET >: < one line summary of change less than 65 characters >
  2. Detailed reason for change information
  3. Test procedure. Only references links to Jira ticket or sub tickets where test steps and references are captured.

< JIRA TICKET >: < one line summary of change less than 65 characters >
< empty line >
Reason for change:
Test Procedure: < https://ccp.sys.comcast.net/browse/JIRA TICKET/url/to/test_step_section>

@jaihere4u jaihere4u closed this Nov 2, 2026
@jaihere4u
jaihere4u deleted the RDKEMW-28136-task-exception-guard branch November 2, 2026 15:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant