Skip to content

Commit f8e222a

Browse files
authored
Dont produce pumors when myself is dead (#45)
This is a follow-up for #42 (issue #35). In addition to the explicit flag, this patch implicitly disables suspiciousness in case the current instance is dead.
1 parent 0cbd175 commit f8e222a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
### Added
1010

1111
- New option `SUSPICIOUSNESS` (default: `true`) allows to
12-
disable generation of rumors about suspected members.
12+
disable generation of rumors about suspected members. Also,
13+
membership won't produce any rumors unless myself is alive.
1314

1415
- New option `log_debug` which can be easily overridden to
1516
control the verbosity level.

membership.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,10 @@ local function _protocol_step()
508508
members.set(uri, member.status, member.incarnation, { clock_delta = delta })
509509
return
510510
elseif members.get(uri).status == opts.ALIVE then
511-
if opts.SUSPICIOUSNESS == false then
511+
local myself = members.get(advertise_uri)
512+
if myself.status ~= opts.ALIVE then
513+
opts.log_debug('Could not reach node: %s (%s myself)', uri, myself.status)
514+
elseif opts.SUSPICIOUSNESS == false then
512515
opts.log_debug('Could not reach node: %s (ignored)', uri)
513516
else
514517
log.info('Could not reach node: %s - %s', uri,

0 commit comments

Comments
 (0)