Notifications are pused in job queue. During switchover, active controller will
empty the job queue. Since notifications allocate memory it needs to be freed.
Here is the patch to avoid this memory leak:
diff --git a/osaf/services/saf/amf/amfd/ntf.cc
b/osaf/services/saf/amf/amfd/ntf.cc
--- a/osaf/services/saf/amf/amfd/ntf.cc
+++ b/osaf/services/saf/amf/amfd/ntf.cc
@@ -573,6 +573,12 @@ SaAisErrorT avd_try_send_notification(Nt
rc = saNtfNotificationFree(notificationHandle);
if ((rc == SA_AIS_ERR_TRY_AGAIN) || (rc == SA_AIS_ERR_TIMEOUT)) {
TRACE("Notification Free unsuccesful TRY_AGAIN or TIMEOUT rc:%u", rc);
+ } else {
+ if (myntf->notificationType == SA_NTF_TYPE_STATE_CHANGE) {
+ myntf->notification.stateChangeNotification.notificationHandle = 0;
+ } else if (myntf->notificationType == SA_NTF_TYPE_ALARM) {
+ myntf->notification.alarmNotification.notificationHandle = 0;
+ }
}
done:
@@ -887,4 +893,15 @@ AvdJobDequeueResultT NtfSend::exec(const
}
NtfSend::~NtfSend() {
+ SaAisErrorT rc = SA_AIS_OK;
+ if (myntf.notificationType == SA_NTF_TYPE_STATE_CHANGE) {
+ if (myntf.notification.stateChangeNotification.notificationHandle != 0)
+ rc =
saNtfNotificationFree(myntf.notification.stateChangeNotification.notificationHandle);
+ } else if (myntf.notificationType == SA_NTF_TYPE_ALARM) {
+ if (myntf.notification.alarmNotification.notificationHandle != 0)
+ rc =
saNtfNotificationFree(myntf.notification.alarmNotification.notificationHandle);
+ }
+ if (rc != SA_AIS_OK) {
+ TRACE("Notification Free failed rc:%u", rc);
+ }
}
I will send it officially.
---
** [tickets:#314] AMF looses alarms and notifications during switch-over**
**Status:** fixed
**Milestone:** 5.0.2
**Created:** Fri May 24, 2013 08:34 AM UTC by Nagendra Kumar
**Last Updated:** Thu Nov 10, 2016 08:33 AM UTC
**Owner:** Praveen
**Attachments:**
- [messages](https://sourceforge.net/p/opensaf/tickets/314/attachment/messages)
(41.9 kB; application/octet-stream)
- [osafamfd](https://sourceforge.net/p/opensaf/tickets/314/attachment/osafamfd)
(5.7 MB; application/octet-stream)
Migrated from http://devel.opensaf.org/ticket/3051
Background: http://devel.opensaf.org/ticket/3028
If another node (payload) leaves the cluster in the middle of switch-over, amfd
logs this:
Mar 8 10:18:21 SC-1 osafamfd[304]: ER sendStateChangeNotificationAvd:
saNtfNotificationSend Failed (6)
Mar 8 10:18:21 SC-1 osafamfd[304]: ER sendAlarmNotificationAvd:
saNtfNotificationSend Failed (6)
These logs means that amfd failed to send an alarm and a notification due to
TRYAGAIN returned from NTF (in NOACTIVE state)
AMF needs to store the alarms/notifications produced in the NOACTIVE state and
send them at the end of the switch-over. Or with using a separate thread that
can block forever (?) on TRYAGAIN.
The problem exist in all opensaf releases
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.------------------------------------------------------------------------------
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets