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

Flush is broken when ordering enabled and multiple batches present #1702

Conversation

kimjoar
Copy link

@kimjoar kimjoar commented Mar 28, 2023

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Note: If you are opening a pull request against a legacy branch, PLEASE BE AWARE that we generally won't accept these except for things like important security fixes, and only for a limited time.


flush is currently broken when you have ordering + multiple batches when the flush occurs, as publishDrain gets called with a callback that's dropped in the publish implementation of OrderedQueue. The callback is not passed on to beginNextPublish, so the flush will never complete as it's waiting for the callback to be called. Looks like this came in with #1691.

Haven't looked into tests etc. Let me know what you think makes sense, if this is interesting to merge.

@kimjoar kimjoar requested review from a team as code owners March 28, 2023 19:36
@google-cla
Copy link

google-cla bot commented Mar 28, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: pubsub Issues related to the googleapis/nodejs-pubsub API. labels Mar 28, 2023
@kimjoar kimjoar changed the title Fix ordering when flush and multiple batches Flush is broken when ordering enabled and multiple batches present Mar 28, 2023
@conventional-commit-lint-gcf
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@kimjoar kimjoar force-pushed the kim/fix-flush-when-ordering-and-batches branch from 20018b6 to 269664b Compare March 28, 2023 19:40
@kimjoar
Copy link
Author

kimjoar commented Apr 1, 2023

I think I've realized that flush shouldn't be used at all, and breaks ordering, if I'm not mistaken. Not clear from the docs.

@kimjoar kimjoar closed this Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant