RDKEMW-16000: Add refreshHandles in libds.#172
RDKEMW-16000: Add refreshHandles in libds.#172santoshcomcast wants to merge 2 commits intodevelopfrom
Conversation
Reason for change: These refreshHandles() api calls when dsmgr restart. Test Procedure: refer RDKEMW-16000 Risks: High Signed-off-by:gsanto722 <grandhi_santoshkumar@comcast.com>
There was a problem hiding this comment.
Pull request overview
Adds an IARM bus event broadcast to let libds clients know that dsmgr has restarted and HAL handles are valid again, and updates the systemd unit to ensure dsmgr is restarted automatically.
Changes:
- Broadcast
IARM_BUS_DSMGR_EVENT_RESTARTEDat the end ofDSMgr_Start()after init/resolution/platform setup. - Add
Restart=alwaystoconf/dsmgr.servicesodsmgris automatically restarted by systemd.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
dsmgr/dsMgr.c |
Broadcasts a new “restarted” event to notify clients they should refresh stale handles after a dsmgr restart. |
conf/dsmgr.service |
Configures systemd to always restart dsmgr. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* Notify all libds clients (e.g. DisplaySettings plugin) that dsmgr has | ||
| * fully restarted and all HAL handles are now valid. | ||
| * | ||
| * Clients that registered for IARM_BUS_DSMGR_EVENT_RESTARTED will call | ||
| * refreshAllHandles() on their local config singletons to replace any | ||
| * stale intptr_t handles left over from the previous dsmgr process. | ||
| * |
There was a problem hiding this comment.
The PR title/description references adding refreshHandles in libds, but this change set only updates dsmgr startup behavior and the systemd unit. If the libds-side API/event handling changes are required for this feature to work, they should be included here; otherwise please update the PR title/description to match what’s actually being changed.
| iarmStatus = IARM_Bus_BroadcastEvent(IARM_BUS_DSMGR_NAME, | ||
| (IARM_EventId_t)IARM_BUS_DSMGR_EVENT_RESTARTED, | ||
| (void *)&eventData, sizeof(eventData)); | ||
| } |
There was a problem hiding this comment.
This uses IARM_BUS_DSMGR_EVENT_RESTARTED, but that event ID needs to be part of the DSMgr public event enum and within the range registered via IARM_Bus_RegisterEvent(IARM_BUS_DSMGR_EVENT_MAX). In this repo there are no other references/definitions of IARM_BUS_DSMGR_EVENT_RESTARTED, so please ensure the corresponding header/enum (and *_EVENT_MAX) is updated in the same change set or the required dependency bump is included; otherwise the broadcast will fail (or the build may break if the symbol is undefined).
Reason for change: Broadcast IARM_BUS_DSMGR_EVENT_RESTARTED from dsmgr.
Test Procedure: refer RDKEMW-16000
Risks: High
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com