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
I have examined at the Fetch code in js.go and I think there may be some issues with the logic:
When a context is passed in that has a context timeout, and no explicit PullOpts timeout, the code sets the internal ttl to the default timeout value. It uses this default value ttl to time out the request returning context.DeadlineExceeded thereby ignoring the context timeout value.
When a timeout value is provided through PullOpts without a context, the timeout value is respected.
The check at the start of the function prevents supplying both, so therefore it is therefore impossible to provide a cancellable context to Fetch, and and also a timeout.
Providing no timeout value is causing Fetch to stall for us, but I also need to be able to cancel the context during a graceful shutdown of the server.
The text was updated successfully, but these errors were encountered:
ifttl<0 {
// At this point consider that we have timed-outreturncontext.DeadlineExceeded
}
Maybe I'm incorrect, but a context has already been assured with a timeout value. If that's right, shouldn't this just check for the context being invalidated instead of ttl?
nats.go version: 1.13.3
nats version: 2.6.1
I have examined at the Fetch code in
js.go
and I think there may be some issues with the logic:When a context is passed in that has a context timeout, and no explicit
PullOpts
timeout, the code sets the internalttl
to the default timeout value. It uses this default valuettl
to time out the request returningcontext.DeadlineExceeded
thereby ignoring the context timeout value.When a timeout value is provided through
PullOpts
without a context, the timeout value is respected.The check at the start of the function prevents supplying both, so therefore it is therefore impossible to provide a cancellable context to Fetch, and and also a timeout.
Providing no timeout value is causing Fetch to stall for us, but I also need to be able to cancel the context during a graceful shutdown of the server.
The text was updated successfully, but these errors were encountered: