Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gazette/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a15f5ad4a6091f1ccb2d90951a27743b57ecbe06
Choose a base ref
..
head repository: gazette/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 040492e30231608c4f5f1aa02bd689839a8d6bcd
Choose a head ref
Showing with 9 additions and 1 deletion.
  1. +9 −1 broker/client/retry_reader.go
10 changes: 9 additions & 1 deletion broker/client/retry_reader.go
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ func (rr *RetryReader) Read(p []byte) (n int, err error) {
var squelch bool

switch err {
case context.DeadlineExceeded, context.Canceled, ErrJournalNotFound:
case context.DeadlineExceeded, context.Canceled:
return // Surface to caller.
case ErrOffsetNotYetAvailable:
if rr.Reader.Request.Block {
@@ -104,6 +104,14 @@ func (rr *RetryReader) Read(p []byte) (n int, err error) {
// Suppress logging for expected errors on first read attempt.
// We may be racing a concurrent Etcd watch and assignment of the broker cluster.
squelch = attempt == 0
case ErrJournalNotFound:
// If a Header was attached to the request, the journal was not found
// even after honoring its read-through Etcd revision. If not,
// we allow a handful of attempts to work around expected propagation
// delays of Etcd revisions if the journal was just created.
if rr.Reader.Request.Header != nil || attempt > 3 {
return // Surface to caller.
}
case io.EOF:
// EOF means we had an established RPC, but it might not have sent
// any data before being closed server-side, so clear `attempts` to