Jan Schär 605abca29d etcdserver: fix panic when checking IsLearner of removed member
Previously, calling s.IsLearner() when the local node is no longer a
member panics. There was an attempt to fix this by first checking
IsMemberExist(), but this is not a correct fix because the member could
be removed between the two calls. Instead of panicking when the member
was removed, IsLearner() should return false. A node which is not a
member is also not a learner.

There was a similar concurrency bug when accessing the IsLearner
property of a member, which will panic with a nil pointer access error
if the member is removed between the IsMemberExist() and Member() calls.

Signed-off-by: Jan Schär <jan@monogon.tech>
2024-09-25 17:31:30 +02:00
..
2024-09-24 12:55:24 -05:00
2020-10-26 13:02:32 +01:00