Skip to content

Commit

Permalink
RDKTV-30997, RDKTV-31062 : Re-activate after 5s when monitored plugin…
Browse files Browse the repository at this point in the history
… crashes (#5443)

In the Thunder R4 releases,

1. The lifetime of the plugin status must be learned by ILifeTime notification.
2. The current state machine posts only Activated and Deactivated event.
3. Also, the Deactivated event is posted to all the listeners to give-up the subscription n other things before unloading the plugin library from the execution context.
4. The internal state of plugin managed by Thunder is set to DEACTIVATION and then notifies the clients as mentioned above and finally when dlclose() is done, it sets the state to DEACTIVATED.
5. Meanwhile when Monitor plugin calls ACTIVATE by getting the statechange notification as part of (3) where as the internal state is still DEACTIVATION.
6. This activate request will fail as the unloading of library is still in process.
7. The Monitor plugin must be updated to use ILifeTime or Thunder core has to be updated to use proper eventing.
8. But until then, we can update the Monitor to call activate after 5s when it receives deactivated notification.

Signed-off-by: Karunakaran A [email protected]
  • Loading branch information
karuna2git authored Jun 21, 2024
1 parent f47c94d commit 0cf430c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file.
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
## [1.0.7] - 2024-06-20
### Added
- Added Delay in Thread Restart Logic

## [1.0.6] - 2024-03-29
### Security
- Resolved security vulnerabilities
Expand Down
2 changes: 1 addition & 1 deletion Monitor/Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 6
#define API_VERSION_NUMBER_PATCH 7

namespace WPEFramework {

Expand Down
2 changes: 1 addition & 1 deletion Monitor/Monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ namespace Plugin {
_service->Notify(message);
_parent.event_action(callsign, "Activate", "Automatic");
TRACE(Trace::Error, (_T("Restarting %s again because we detected it misbehaved."), callsign.c_str()));
Core::IWorkerPool::Instance().Schedule(Core::Time::Now(), PluginHost::IShell::Job::Create(service, PluginHost::IShell::ACTIVATED, PluginHost::IShell::AUTOMATIC));
Core::IWorkerPool::Instance().Schedule(Core::Time::Now().Add(5000), PluginHost::IShell::Job::Create(service, PluginHost::IShell::ACTIVATED, PluginHost::IShell::AUTOMATIC));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/MonitorPlugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a name="Monitor_Plugin"></a>
# Monitor Plugin

**Version: [1.0.6](https://github.com/rdkcentral/rdkservices/blob/main/Monitor/CHANGELOG.md)**
**Version: [1.0.7](https://github.com/rdkcentral/rdkservices/blob/main/Monitor/CHANGELOG.md)**

A Monitor plugin for Thunder framework.

Expand Down

0 comments on commit 0cf430c

Please sign in to comment.