-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark any exception before the first message is written as retryable (#…
…1641) Motivation: If the `Channel` is already closed before we attempt the first write, we wrap it with `AbortedFirstWrite` in `WriteStreamSubscriber` and re-wrap with `RetryableClosureException` in `DefaultNettyConnection`. This approach has a couple of disadvantages: 1. `AbortedFirstWrite` is not a `RetryableException` and if the `closeReason` is not known in `DefaultNettyConnection`, the original exception will be propagated as-is without `RetryableException` marker; 2. `WriteStreamSubscriber` prematurely sets `written` flag before we attempt the first write, that may also fail even if the `Channel` is not closed; Modifications: - `WriteStreamSubscriber`: mark internal state as `written` only after the first msg successfully goes through the outbound channel pipeline; - Rename `AbortedFirstWrite` -> `AbortedFirstWriteException` and make it retryable `IOException` because it indicates only IO failures; - Wrap any error that happened before the first msg is written with `AbortedFirstWriteException`; - Adjust `DefaultNettyConnection#enrichError` to correctly unwrap `AbortedFirstWriteException`; - Adjust tests for new behavior; Result: Any failure before the first message is written is marked as retryable.
- Loading branch information
1 parent
1c19c0a
commit a0c4a43
Showing
10 changed files
with
91 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters