Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Fetch() behavior to not verify request ID #1238

Merged
merged 1 commit into from
Mar 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions js.go
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ func (sub *Subscription) Fetch(batch int, opts ...PullOpt) ([]*Msg, error) {

nc := sub.conn
nms := sub.jsi.nms
rply, reqID := newFetchInbox(jsi.deliver)
rply, _ := newFetchInbox(jsi.deliver)
js := sub.jsi.js
pmc := len(sub.mch) > 0

Expand Down Expand Up @@ -2753,17 +2753,10 @@ func (sub *Subscription) Fetch(batch int, opts ...PullOpt) ([]*Msg, error) {
// wait this time.
noWait = false
err = sendReq()
} else if err == ErrTimeout {
} else if err == ErrTimeout && len(msgs) == 0 {
// If we get a 408, we will bail if we already collected some
// messages, otherwise ignore and go back calling nextMsg.
if len(msgs) == 0 {
err = nil
continue
}
// ignore timeout message from server if it comes from a different pull request
if reqID != "" && !subjectMatchesReqID(msg.Subject, reqID) {
err = nil
}
err = nil
}
}
}
Expand Down