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

Producer#flush doesn't respect non-batched messages #51

Closed
2 tasks done
equanz opened this issue Oct 14, 2022 · 2 comments
Closed
2 tasks done

Producer#flush doesn't respect non-batched messages #51

equanz opened this issue Oct 14, 2022 · 2 comments
Assignees

Comments

@equanz
Copy link
Contributor

equanz commented Oct 14, 2022

Search before asking

  • I searched in the issues and found nothing similar.

Version

main( ba1a7e1 )

Minimal reproduce step

  1. Create a producer with batchingEnabled=false
  2. Send some messages asynchronously
  3. Call Producer#flush or Producer#flushAsync
  4. (Close a producer)
  • to get AlreadyClosed exception
    // ensure any remaining send callbacks are called before calling the close callback
    failPendingMessages(ResultAlreadyClosed, false);

What did you expect to see?

When Producer#flush or Producer#flushAsync is called, wait for the completion of sending messages, even if non-batched messages.

What did you see instead?

Producer#flush and Producer#flushAsync don't guarantee the completion of sending non-batched messages.

Anything else?

Currently, ProducerImpl#flushAsync do nothing if batchMessageContainer_ is not initialized.

} else {
callback(ResultOk);
}

In Java client, wait last sent messages. We should implement C++ client like it.
apache/pulsar#2103

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@shibd
Copy link
Member

shibd commented Oct 28, 2022

I reproduced it and I'll start fixing it.

@equanz
Copy link
Contributor Author

equanz commented Nov 15, 2022

I'll close this issue because #98 was merged.
Thank you @shibd.

@equanz equanz closed this as completed Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants