Disable synchronous play in RialtoServer as it caused some race conditions#507
Disable synchronous play in RialtoServer as it caused some race conditions#507Koky2701 wants to merge 1 commit into
Conversation
…tions (#494) Summary: Disable synchronous play in RialtoServer as it caused some race conditions Type: Fix Test Plan: UT/CT, Fullstack Jira: RDKEMW-18286
|
Pull request must be merged with a description containing the required fields, Summary: If there is no jira releated to this change, please put 'Jira: NO-JIRA'. Description can be changed by editing the top comment on your pull request and making a new commit. |
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate “synchronous play” behavior in the Rialto server path to reduce race conditions by ensuring play requests are dispatched via the normal main-thread queue and executed asynchronously on the player worker thread.
Changes:
- Switch
MediaPipelineServerInternal::play()fromenqueuePriorityTaskAndWaittoenqueueTaskAndWait. - Make
GstGenericPlayer::play()always asynchronous (enqueue play task on the worker thread and setasync=true). - Update/remove unit tests and test helpers that relied on synchronous/priority play behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/media/server/main/mediaPipeline/MiscellaneousFunctionsTest.cpp | Updates play-related expectations to use non-priority main-thread enqueue behavior. |
| tests/unittests/media/server/main/mediaPipeline/base/MediaPipelineTestBase.h | Removes the priority-enqueue test helper declaration. |
| tests/unittests/media/server/main/mediaPipeline/base/MediaPipelineTestBase.cpp | Removes the priority-enqueue test helper implementation. |
| tests/unittests/media/server/gstplayer/genericPlayer/GstGenericPlayerTest.cpp | Removes tests covering immediate synchronous/asynchronous play; keeps worker-thread play test with async=true. |
| media/server/main/source/MediaPipelineServerInternal.cpp | Routes play via enqueueTaskAndWait instead of priority enqueue. |
| media/server/gstplayer/source/GstGenericPlayer.cpp | Forces play to be worker-thread queued and always asynchronous; removes state-change counter usage. |
| media/server/gstplayer/include/GstGenericPlayer.h | Removes the m_ongoingStateChangesNumber atomic member. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bool result; | ||
| auto task = [&]() { result = playInternal(async); }; | ||
|
|
||
| m_mainThread->enqueuePriorityTaskAndWait(m_mainThreadClientId, task); | ||
| m_mainThread->enqueueTaskAndWait(m_mainThreadClientId, task); | ||
| return result; |
Summary: Disable synchronous play in RialtoServer as it caused some race conditions
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-18286