Ack, comment inline
/Hans

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: den 23 juni 2014 14:14
> To: Hans Feldt; [email protected]
> Cc: [email protected]
> Subject: [PATCH 4 of 4] amfnd : inform AMFD to send error clear notification 
> [#106]
> 
>  osaf/services/saf/amf/amfd/ntf.cc    |   3 +++
>  osaf/services/saf/amf/amfnd/amfnd.cc |  16 ++++++++++++++++
>  osaf/services/saf/amf/amfnd/comp.cc  |  10 ++++++++++
>  osaf/services/saf/amf/amfnd/err.cc   |   6 ++++++
>  4 files changed, 35 insertions(+), 0 deletions(-)
> 
> 
> 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
> @@ -739,6 +739,9 @@ void avd_send_error_report_ntf(const SaN
>                               (NCSCONTEXT) &add_info,
>                               1 /* No add_info */);
> 
> +     } else {
> +             avd_alarm_clear(name, SA_AMF_NTFID_ERROR_CLEAR,
> +                             SA_NTF_SOFTWARE_ERROR);
>       }
> 
>       TRACE_LEAVE();
> diff --git a/osaf/services/saf/amf/amfnd/amfnd.cc 
> b/osaf/services/saf/amf/amfnd/amfnd.cc
> --- a/osaf/services/saf/amf/amfnd/amfnd.cc
> +++ b/osaf/services/saf/amf/amfnd/amfnd.cc
> @@ -395,6 +395,22 @@ uint32_t avnd_evt_avd_reboot_evh(AVND_CB
>       avnd_msgid_assert(info->msg_id);
>       cb->rcv_msg_id = info->msg_id;
> 
[Hans] the code block below is uncommented, what is the purpose? Clearing error 
reports when the node is about to be rebooted?

> +     for (AVND_COMP *comp = (AVND_COMP 
> *)ncs_patricia_tree_getnext(&avnd_cb->compdb, (uint8_t *)0);
> +               comp;
> +               comp = (AVND_COMP *) 
> ncs_patricia_tree_getnext(&avnd_cb->compdb, (uint8_t *)&comp->name)) {
> +
> +             /* Skip OpenSAF and external components */
> +             if (comp->su->is_ncs || comp->su->su_is_external)
> +                     continue;
> +
> +             if (comp->error_report_ntf == true) {
[Hans] maybe error_report_has_been_sent is a more logical name?

> +                     avnd_di_uns32_upd_send(AVSV_SA_AMF_COMP, 
> saAmfCompRecoveryOnError_ID,
> +                                     &comp->name, AVSV_ERR_RCVR_MAX);
> +                     comp->error_report_ntf = false;
> +             }
> +
> +     }
> +
>       LOG_NO("Received reboot order, ordering reboot now!");
>       opensaf_reboot(cb->node_info.nodeId,
>                                  (char 
> *)cb->node_info.executionEnvironment.value,
> diff --git a/osaf/services/saf/amf/amfnd/comp.cc 
> b/osaf/services/saf/amf/amfnd/comp.cc
> --- a/osaf/services/saf/amf/amfnd/comp.cc
> +++ b/osaf/services/saf/amf/amfnd/comp.cc
> @@ -2714,6 +2714,16 @@ void avnd_comp_pres_state_set(AVND_COMP
>       if (comp->pres == SA_AMF_PRESENCE_TERMINATION_FAILED)
>               avnd_failed_state_file_create();
> 
> +     /* Inform AMFD to generate ErrorClear() notification */
> +     if ((comp->error_report_ntf == true) &&
> +                     ((comp->pres == SA_AMF_PRESENCE_UNINSTANTIATED) ||
> +                      (comp->pres == SA_AMF_PRESENCE_INSTANTIATED)) &&
> +                     (comp->oper == SA_AMF_OPERATIONAL_ENABLED)) {
> +             avnd_di_uns32_upd_send(AVSV_SA_AMF_COMP, 
> saAmfCompRecoveryOnError_ID,
> +                             &comp->name, AVSV_ERR_RCVR_MAX);
> +             comp->error_report_ntf = false;
> +     }
> +
>       m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, AVND_CKPT_COMP_PRES_STATE);
>  }
> 
> diff --git a/osaf/services/saf/amf/amfnd/err.cc 
> b/osaf/services/saf/amf/amfnd/err.cc
> --- a/osaf/services/saf/amf/amfnd/err.cc
> +++ b/osaf/services/saf/amf/amfnd/err.cc
> @@ -279,6 +279,12 @@ uint32_t avnd_evt_ava_err_clear_evh(AVND
>               err_info = &comp->err_info;
>               err_info->src = static_cast<AVND_ERR_SRC>(0);
>               err_info->detect_time = 0;
> +             /* Inform AMFD to generate ErrorClear() notification */
> +             if (comp->error_report_ntf == true) {
> +                     avnd_di_uns32_upd_send(AVSV_SA_AMF_COMP, 
> saAmfCompRecoveryOnError_ID,
> +                                     &comp->name, AVSV_ERR_RCVR_MAX);
> +                     comp->error_report_ntf = false;
> +             }
> 
>               m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
> AVND_CKPT_COMP_ERR_INFO);
>       }

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to