-
Notifications
You must be signed in to change notification settings - Fork 7
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
question about channel pendingAck implementation. #11
Comments
hey @1046102779 sorry for taking too long for responding back,
Please, notice that
The default ack timeout of 1s is used when the message was actually ack'ed but there's no consumer waiting for the ack, so it would probably lead in two scenarios:
by using this msgID, pendingAck, cleanup, ackTimeoutFlagFunc := ackManager.Get()
......
select {
case resp := <-pendingAck:
return resp.data, resp.err
case <-ackTimeoutFlagFunc(): // return Ack timeout flag.
return nil, ErrAckTimeout
case <-ctx.Done():
return nil, nil
} we are also saying that the underlying component will consider the message as successfully delivered as the Please, see if it makes sense to you @1046102779 |
ping @1046102779 |
I'll take a closer look at the entire process. Thank you for your detailed reply. |
I see that pluggable component go-sdk transforms streaming into unary mode. In a question-and-answer implementation, there is a paragraph in github.com/dapr-sandbox/components-go-sdk/bindings/v1/handle.go code snippet about pendingAck:
If the channel pendingAck receives data timeout (default: 1s), the ACK API will directly return nil, but after executing the Send API, waiting for pendingAck will hang in/out, and the select <-ctx.Done here is to wait for the upstream to actively complete the request. and returns ErrAckTimeout. In fact, the ErrAckTimeout returned here is not suitable, it should be the upstream end of the request.
I think the correct approach should be: AcknowledgementManager.Ack API should also take ackTimeoutFlagFunc API as a return parameter, and then uniformly handle timeout, is it more appropriate? similar:
include pubsub/bindings/state...
My main point is that when the Ack API has a processing timeout (default: 1s), the pendingAck returned by the Get API also needs to know this timeout, and then return directly without blocking waiting and relying on upstream active processing. Or should there be absolutely no packet loss?
The text was updated successfully, but these errors were encountered: