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 (rdkcentral#5473)

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.

Test Procedure: Verified in Jenkins Build
Risks: High
Signed-off-by: Thamim  Razith <[email protected]>
  • Loading branch information
tabbas651 authored Jul 1, 2024
1 parent 65e4e2a commit 5b36bf3
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 @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [1.0.8] - 2024-07-01
### Changed
- Added Delay in Thread Restart Logic

## [1.0.7] - 2024-05-31
### Changed
- RDK-45345: Upgrade Sky Glass devices to use Thunder R4.4.1
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 8

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.7](https://github.com/rdkcentral/rdkservices/blob/main/Monitor/CHANGELOG.md)**
**Version: [1.0.8](https://github.com/rdkcentral/rdkservices/blob/main/Monitor/CHANGELOG.md)**

A Monitor plugin for Thunder framework.

Expand Down

0 comments on commit 5b36bf3

Please sign in to comment.