Skip to content

cloudpubsub: apply ReceiveSettings to Subscription - #40

Open
fohte wants to merge 3 commits into
masterfrom
fohte/fix-cloudpubsub-receive-settings
Open

cloudpubsub: apply ReceiveSettings to Subscription#40
fohte wants to merge 3 commits into
masterfrom
fohte/fix-cloudpubsub-receive-settings

Conversation

@fohte

@fohte fohte commented Aug 31, 2026

Copy link
Copy Markdown

Why

  • The pubsub.ReceiveSettings passed to cloudpubsub.WithReceiveSettings never reached the actual subscription, so it always ran with the library's default settings

What

  • Apply ReceiveSettings to the pubsub.Subscription created by CreateSubscriber

fohte added 3 commits August 31, 2026 18:55
intent(cloudpubsub): make WithReceiveSettings actually take effect, since
CreateSubscriber built the pubsub.Subscription but never copied
Config.ReceiveSettings onto it, so Receive always ran with the library's
zero-value/default settings regardless of the option
learned(cloudpubsub): a zero pubsub.ReceiveSettings is equivalent to
DefaultReceiveSettings (cloud.google.com/go/pubsub falls back per-field in
Subscription.Receive), so assigning cfg.ReceiveSettings is a no-op for
callers who never set the option
intent(cloudpubsub): replace the white-box regression test with a black-box
one that drives the public Subscriber interface, per the project's protective
test guideline of testing only through the public API
learned(cloudpubsub): the client's flow controller enforces
MaxOutstandingMessages by blocking delivery of the next message until an
in-flight one is acked, independent of NumGoroutines/Synchronous, so capping
it at 1 gives a deterministic (non-flaky) way to observe whether the setting
reached the Subscription
decision(cloudpubsub): extract the pstest/gRPC/client setup shared by both
tests into a newTestEnv helper instead of duplicating it, since the two tests
now differ only in the options passed to CreateSubscriber
intent(cloudpubsub): keep only the non-obvious fact (flow control bounds
concurrency independent of NumGoroutines) instead of restating what the test
name and body already say
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

Successfully merging this pull request may close these issues.

1 participant