-
Notifications
You must be signed in to change notification settings - Fork 672
Fix panic after UpdateAnnotation error #3612
Conversation
Hi @scritchley, and thanks for this PR. I don't think this change is right - the code changes the local copy of the map then contacts the server, expecting the server will send back an up-to-date map. (And, as you say, it may send back nil, which is not what the code is expecting) If you simply exit the function on error the map is now wrong, since it contains the "speculative" update. Can I suggest you open an issue indicating the path that led to a crash, in case that suggests any other ways to address it. |
Ok, will do. |
Linking to issue: #3613 Do you think you will come back to this? If not, we will pick it up. |
We are more than happy to help fix this if you want to have a discussion about potential solutions? :) |
Two possible routes:
I think I prefer the first, but it's hard to be sure without seeing an implementation |
Route 1 sounds good to me. Could you clarify what you mean by:
Do you mean every function that calls |
Like this for example: weave/prog/kube-utils/peerlist.go Lines 76 to 90 in 0d481ef
Every time round, |
I'm going to close this in favour of #3623, for reasons given at #3612 (comment) I didn't follow my own suggestion above to use Many thanks for your interest, and I hope you will consider contributing again. |
…ecedence (if there is any conflict in merging entry) over other opertaions on the entry that increments the version Fixes #3612
…ecedence (if there is any conflict in merging entry) over other opertaions on the entry that increments the version Fixes #3612
takes precedence (if there is any conflict in merging entry) over other operations on the entry that increments the version Fixes #3612
Fixes a panic in kube-utils. If there is an error calling
(*configMapAnnotations).UpdateAnnotation
it currently assigns an emptyv1.ConfigMap
to the receiver. This results in a panic when assigning to the annotations map on further updates.The impact of this issue is fairly large as it results in the reclaim daemon exiting, which in turn results in dead peers not being removed. In a cluster that uses auto scaling this is a big problem.
The proposed fix checks for errors before assigning the ConfigMap and adds an additional nil check before making updates to the annotation map.
Panic attached:
kube-utils-panic.txt