It is expected that resending introduceMsg should happen every 05 seconds
if the previous send has not yet received the response e.g because of having
network issue or having the active IMMD unresponsive. However, in some cases,
the re-send is done every 0.1 second.

This patch adds a few code to make the logic work as expectation.
---
 src/imm/immnd/immnd_proc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c
index b03063882..62547ead2 100644
--- a/src/imm/immnd/immnd_proc.c
+++ b/src/imm/immnd/immnd_proc.c
@@ -2024,6 +2024,7 @@ uint32_t immnd_proc_server(uint32_t *timeout)
        struct timespec jobDurationTs;
        osaf_timespec_subtract(&now, &cb->mJobStart, &jobDurationTs);
        SaUint32T jobDurationSec = (SaUint32T)jobDurationTs.tv_sec;
+       static SaUint32T prev_jobduration = 0;
        bool pbeImmndDeadlock = false;
        if (!jobDurationSec) {
                ++jobDurationSec;
@@ -2050,6 +2051,7 @@ uint32_t immnd_proc_server(uint32_t *timeout)
        switch (cb->mState) {
        case IMM_SERVER_ANONYMOUS: /*send introduceMe msg. */
                /*TRACE_5("IMM_SERVER_ANONYMOUS");*/
+               prev_jobduration = jobDurationSec;
                if (immnd_introduceMe(cb) == NCSCC_RC_SUCCESS) {
                        cb->mStep = 0;
                        cb->mJobStart = now;
@@ -2108,11 +2110,12 @@ uint32_t immnd_proc_server(uint32_t *timeout)
                                            immnd_forkLoader(cb, true);
                                }
                        } else if (!(jobDurationSec %
-                                    5)) { /* Every 5 seconds */
+                                    5) && (jobDurationSec != 
prev_jobduration)) { /* Every 5 seconds */
                                LOG_WA(
                                    "Resending introduce-me - problems with MDS 
? %f",
                                    osaf_timespec_to_double(&jobDurationTs));
                                immnd_introduceMe(cb);
+                               prev_jobduration = jobDurationSec;
                        }
 
                        if (cb->preLoadPid > 0) {
-- 
2.18.0



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to