Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Avoid panic on nil map in reclaimPeer() #3623

Merged
merged 5 commits into from
May 7, 2019
Merged

Conversation

bboreham
Copy link
Contributor

Re-read peers ConfigMap from Kubernetes at start of every reclaim - a previous reclaim may have left the map set to nil.

Fixes #3613

Also make test harness and comments match Kubernetes behaviour on conflict error,
and error instead of panic if we still do somehow have a nil map

… error

Kubernetes always returns nil on error; somehow I had the wrong idea
here.
It can be set to nil after a failed update; check rather than crashing.
A previous reclaim may have left the map set to nil.
@bboreham bboreham changed the base branch from master to 2.5 March 26, 2019 17:29
@murali-reddy
Copy link
Contributor

LGTM

This avoids a race condition where the peer has added itself to the
list and the annotation since we read storedPeerList.
@bboreham
Copy link
Contributor Author

bboreham commented Apr 2, 2019

I added another change, since I realised passing in storedPeerList is unsafe.

@bboreham bboreham added this to the 2.5.2 milestone Apr 24, 2019
@murali-reddy
Copy link
Contributor

changes LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants