-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add possible cancel of DeferredConfirmation #92
Comments
Is using You are synchronously waiting on a publisher confirmation. For the highest performance, our recommendation is to keep track of an acceptable number of outstanding confirmations, perhaps throttling your publishing if this number reaches a threshold. But, we still need to figure out how to cancel a |
I am not sure at 100% but I think benthos spawn multiple write that wait each on their confirmation. I see two common ways to do it in go, the net/http way with a context at query level or io way with Close method. The context seems to be the more common and allow for more advanced use case. Briefly looking at the code, I would say the easiest would be to add a context to PublishWithDeferredConfirm and start a goroutine in |
In case of network error (supposed), a program using DeferredConfirmation can wait indefinitely on .Wait() method.
Linked issue in benthos: redpanda-data/connect#1299
The program can implement a timeout over the wait method but it will not clear it in amqp lib from confirms/deferredConfirmations of the channel.
First, is ok for you to add a cancel solution (new method, add context, ...) ?
If yes, I see many possible solution:
(d *DeferredConfirmation) Wait()
(this need change so that it can clear it self from deferredConfirmations)Which one suit you the most ? or if you have an other to suggest ?
The text was updated successfully, but these errors were encountered: