GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(pubsub): Add Publisher Flow Control by quartzmo · Pull Request #11383 · googleapis/google-cloud-ruby

Conversation

@quartzmo

@quartzmo quartzmo commented May 10, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Reference implementations:

  • Java
  • Python

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label May 10, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label May 10, 2021
@quartzmo quartzmo self-assigned this May 10, 2021
@quartzmo
quartzmo force-pushed the pubsub-publisher-flow-control branch 3 times, most recently from 32ed8aa to 0532f46 Compare May 14, 2021 18:59
@quartzmo
quartzmo marked this pull request as ready for review May 14, 2021 22:00
@quartzmo
quartzmo requested review from a team and kamalaboulhosn May 14, 2021 22:00
@quartzmo

quartzmo commented May 14, 2021

Copy link
Copy Markdown
Member Author

@plamut PTAL if you have time, thank you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plamut
plamut suggested changes May 16, 2021
View reviewed changes

@plamut plamut left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't really know Ruby code and tis common idioms, thus mostly just focused on the bigger picture - it looks good IMO! I like the queue of events so that only a single thread is woken up when a message gets released from the flow control.

I might have missed it, but I don't think we release messages when a random network (or other) error happens, please double check (and add a test or two, if needed).

The rest are mostly remarks/suggestions about making the tests more resilient.

(again, apologies for the noise in advance in case I misunderstood the code 🙂 )

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

quartzmo reacted with heart emoji
All reactions
  • ❤️ 1 reaction
Comment thread google-cloud-pubsub/acceptance/pubsub/schema_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/async_publisher.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/async_publisher/message_ordering_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/async_publisher_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/flow_controller_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/flow_controller_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/topic/publish_async_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

@quartzmo

quartzmo commented May 17, 2021

Copy link
Copy Markdown
Member Author

@plamut Thank you for all these great suggestions!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@quartzmo

quartzmo commented May 17, 2021

Copy link
Copy Markdown
Member Author

@plamut PR updated for all your comment, thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plamut
plamut approved these changes May 18, 2021
View reviewed changes

@plamut plamut left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

From what I can see and understand, I'd say it looks good now, thanks for applying the suggestions.

I trust that the code is idiomatic ruby, and that rubocop thing did not complain. 🤣

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

quartzmo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
dazuma
dazuma suggested changes May 20, 2021
View reviewed changes
Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/async_publisher.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

quartzmo added 13 commits May 20, 2021 08:55
@quartzmo
feat(pubsub): Add Publisher Flow Control
d0ec3ef
@quartzmo
Add flow_control to AsyncPublisher#initialize
4e507cd
@quartzmo
Update documentation for Project#create_topic and Project#topic
29897f7
@quartzmo
Add acceptance test
1317f09
@quartzmo
Fix TODO in existing unit test
a7aefa4
@quartzmo
Fix flakey tests
09d0260
@quartzmo
Fix flakey large message test
b7c2370
@quartzmo
Remove MonitorMixin from FlowController
ada3026
@quartzmo
Ensure that rescue in publish_batch_sync releases flow control permits
7e0b6e4
@quartzmo
Fix flakey acceptance tests
dc42ddd
@quartzmo
Fix unit tests per plamut comments
0e15fac
@quartzmo
Remove unused MonitorMixin from FlowController
0d2f063
@quartzmo
Change @mutex.locked? to @mutex.owned? in FlowController
9434018
@quartzmo
quartzmo force-pushed the pubsub-publisher-flow-control branch from 09026b6 to 5813555 Compare May 20, 2021 15:36
@quartzmo
Fix flakey schema delete acceptance test
f7ce29a
@quartzmo
quartzmo force-pushed the pubsub-publisher-flow-control branch from 5813555 to f7ce29a Compare May 20, 2021 18:13
@quartzmo
Convert FlowController to single queue
d756c79
dazuma
dazuma suggested changes May 24, 2021
View reviewed changes
Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

quartzmo added 3 commits May 27, 2021 11:36
@quartzmo
Enforce queue order per dazuma suggestion
3a529bd
@quartzmo
Add test for unblocking all waiting acquires to byte_limit
631bc96
@quartzmo
Increase wait time for message release in test
1c7ff6f
dazuma
dazuma suggested changes May 27, 2021
View reviewed changes
Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/flow_controller.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/flow_controller_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/flow_controller_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-pubsub/test/google/cloud/pubsub/flow_controller_test.rb Resolved

Uh oh!

There was an error while loading. Please reload this page.

@quartzmo
Updates to flow_controller.rb and tests per dazuma comments
653e63a
dazuma
dazuma approved these changes May 28, 2021
View reviewed changes

@dazuma dazuma left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'd say this is looking good!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

quartzmo reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@plamut

plamut commented May 28, 2021

Copy link
Copy Markdown

Looks good IMO, but again, I'm not fluent in Ruby. :)

quartzmo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@quartzmo

quartzmo commented May 28, 2021

Copy link
Copy Markdown
Member Author

@kamalaboulhosn PTAL when you have a chance, thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kamalaboulhosn
kamalaboulhosn approved these changes Jun 9, 2021
View reviewed changes
@quartzmo
quartzmo merged commit cfa68ba into googleapis:master Jun 10, 2021
@quartzmo
quartzmo deleted the pubsub-publisher-flow-control branch June 10, 2021 15:45
@anguillanneuf anguillanneuf mentioned this pull request Jun 15, 2021
Pub/Sub: add publisher flow control sample #11685
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@plamut plamut plamut approved these changes
@dazuma dazuma dazuma approved these changes
@kamalaboulhosn kamalaboulhosn kamalaboulhosn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@quartzmo quartzmo

Labels

api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@quartzmo @plamut @dazuma @kamalaboulhosn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.