RustToMetal commented on code in PR #4553:
URL: https://github.com/apache/iggy/pull/4553#discussion_r4287214827
##########
foreign/swift/Sources/Iggy/Client/ClientCore.swift:
##########
@@ -192,12 +210,76 @@ actor ClientCore {
guard reconnected != nil else {
throw IggyError(failure.code, context: "the request deadline
passed while reconnecting after: \(error)")
}
- guard replay else {
- logger.warning("Reconnected, but the outcome of command
\(code) is unknown: replaying it could apply it twice")
+ if let retained = request, retained.clientID == session.clientID,
Review Comment:
Fixed in 70ca98ae3. Before the reconnect, `exchange` now marks the outcome
uncertain whenever a replay under a new session would be unsafe, as
`RetryOutcome::for_reconnect` does. A resumed replay that keeps being refused
with `transientNotAccepted` is then graded `transientNotCommitted` and never
restamped, and a `historyUnavailable` answer is graded the same way, so
`sendWithPartitionContext` does not resend under a new route. Tests:
`aRefusedResumedReplayIsNotStampedAfresh` (every attempt keeps one request id)
and `aResumedSendRefusedForItsHistoryIsNotSentAgain` (only replays under its
own id, one route lookup).
##########
foreign/swift/Sources/Iggy/Client/ClientCore.swift:
##########
@@ -192,12 +210,76 @@ actor ClientCore {
guard reconnected != nil else {
throw IggyError(failure.code, context: "the request deadline
passed while reconnecting after: \(error)")
Review Comment:
Fixed in 70ca98ae3. An error thrown by the reconnect is caught: for a
request that is not safe to replay under a new session it becomes
`transientNotCommitted`, and otherwise it goes through `outcome.observe`, as
`reconnect.map_err(|e| retry_outcome.observe(e))` does. The coordinator path
and typed sends now see the unknown outcome instead of
`cannotEstablishConnection` or a credential error. Test:
`aFailedReconnectKeepsTheUnknownOutcome`, where the resume is refused and the
fresh sign-in fails after the write was lost.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]