Bug Fix #1135 BZ 2214288 | Remove Printing inside rpc_WS
to Avoid Race Condition
#1139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explain the changes
rpc_ws.go
to avoid a race condition (anyway, there was a plan to refactor and remove it in RPC WS refactor #811 ).Some details about the investigation:
PendingRequests
is a map insideRPCConnWS
.SendPings()
and goroutineReadMessages()
which inside it we haveHandleResponse()
.HandleResponse()
we lock the part of the code which deletes an element from a map - but a concurrent goroutine might at this time callping
and inside it printRPCConnW
which contains the map.HandleResponse
we delete) and iterate over the map (insideping
read the map).%+v
of the structRPCConnW
) a printing of each property separately. When we had an operator crash the error message changed tofatal error: concurrent map iteration and map write
.Issues: Fixed #1135 , BZ 2214288
Testing Instructions:
kubectl get pods
.