Hi Vu Ack, with minor comments below. See [Lennart]
I have not tested and I have not analyzed the delay mechanism to see if the logic is correct. In general functionality in the code is too distributed/spread out (things that is part of the same logic function e.g. handling this delay is handled in several/many places) and this makes it hard to see how things actually work. This is however not within scope of this fix to handle but try to improve whenever possible while doing any fix. Thanks Lennart -----Original Message----- From: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au> Sent: den 13 november 2018 12:00 To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Lennart Lund <lennart.l...@ericsson.com>; Gary Lee <gary....@dektech.com.au> Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen <vu.m.ngu...@dektech.com.au> Subject: [PATCH 1/1] imm: fix introduceMsg resent in every 0.1 second [#2959] 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 */ [Lennart] Please split the lines in a better way for readability. Example: } else if (!(jobDurationSec % 5) && (jobDurationSec != prev_jobduration)) { /* Every 5 seconds */ [Lennart] Is every 5 seconds correct? In the commit message and ticket the time mentioned is 0.5 secons + 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