You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we are not calling updateIncomingCommunicationMetrics()
b.addRequestInFlightMetrics(-1)
response.handle(nil, dead)
continue
}
In the code above, if a response processing fails in the connection, subsequent responses will not be correctly handled.
Because "dead" is assigned the value "error," it will not be set to nil again.
Why is it designed this way here, or is my understanding incorrect?
The text was updated successfully, but these errors were encountered:
Make dead brokers die harder
When a broker gets an error trying to receive a response (either from the
network layer, or from failing to parse the minimal global header), it should
just abandon ship and die. Save that error and return it immediately for any
further requests we might have made.
- The vast majority of the time the connection is going to be hosed anyways, if
nothing else by being out-of-sync on correlation IDs (which we don't handle
and which doesn't seem particularly urgent).
- All of Sarama's built-in callers (producer/consumer/offset-manager)
immediately `Close` a broker when they receive one of these errors anyways, so
all this does is speed up that in the common case.
*If* one of these errors is recoverable, and *if* there is user-space code
somewhere which actually tries to recover in one of those cases, then that code
would break.
This neatly satisfies one of the XXX comments I left in about this issue from
way back in 2013. The TODOs about correlation ID matching are still present.
sarama/broker.go
Lines 1164 to 1171 in 3fad210
In the code above, if a response processing fails in the connection, subsequent responses will not be correctly handled.
Because "dead" is assigned the value "error," it will not be set to nil again.
Why is it designed this way here, or is my understanding incorrect?
The text was updated successfully, but these errors were encountered: