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

feat(pubsub): retry transient failures in ack/modack in timed unary buffer #18395

Merged

Conversation

NivedhaSenthil
Copy link
Member

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.
  • Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running bundle exec rake ci in the gem subdirectory.
  • Update code documentation if necessary.

closes: #18235

@NivedhaSenthil NivedhaSenthil requested a review from a team as a code owner June 20, 2022 06:00
@NivedhaSenthil NivedhaSenthil changed the title Retry transient failures in ack/modack in timed unary buffer feat(pubsub): retry transient failures in ack/modack in timed unary buffer Jun 20, 2022
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Jun 20, 2022
@NivedhaSenthil
Copy link
Member Author

Tests are failing due to a regression in minitest's latest version(5.16.0). Fixed via #18396

@snippet-bot
Copy link

snippet-bot bot commented Jun 22, 2022

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment


def perform_retry_async ack_ids, ack_deadline_seconds = nil
return unless retry_thread_pool.running?
Concurrent::Promises.future_on(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the thread pool is shut down between the above two lines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It throws #<Concurrent::RejectedExecutionError: Concurrent::RejectedExecutionError> which gets propagated via the error callback registered on subscriber. But this should be a rare scenario as retry_thread_pool would be shutdown only on a stop call on the subscriber and all stream shutdown are waited before shutting the buffer.

@NivedhaSenthil NivedhaSenthil requested a review from a team as a code owner June 28, 2022 11:26
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 Pub/Sub API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pubsub] Retry ack/modack initiated by user in timed unary buffer
2 participants