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

fix(pubsublite): close clients after publisher and subscriber have terminated #3512

Merged
merged 7 commits into from Jan 19, 2021

Conversation

tmdiep
Copy link
Contributor

@tmdiep tmdiep commented Jan 8, 2021

The gapic clients aren't closed once the PublisherClient and SubscriberClient have terminated. This leaves client connections open. We could add an explicit Close() (like the AdminClient) and require users to call it, but we know when the publisher and subscriber have permanently terminated (i.e. when PublisherClient.Stop is called, and when SubscriberClient.Receive returns), so we'll can just close all the gapic clients internally.

This caused all unit tests to fail because a single connection to the mock lite server was being reused. The first test would close it, causing all subsequent tests to fail. So the unit test clients were refactored to create new connections for every test.

@tmdiep tmdiep requested a review from hongalex January 8, 2021 02:13
@tmdiep tmdiep requested a review from a team as a code owner January 8, 2021 02:13
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the Pub/Sub Lite API. label Jan 8, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 8, 2021
@tmdiep tmdiep requested a review from hongalex January 19, 2021 22:30
Copy link
Member

@hongalex hongalex left a comment

Choose a reason for hiding this comment

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

LGTM pending one comment

pubsublite/admin_test.go Outdated Show resolved Hide resolved
@tmdiep tmdiep added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 19, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 19, 2021
@tmdiep tmdiep merged commit 72d2aff into googleapis:master Jan 19, 2021
@tmdiep tmdiep deleted the close_clients branch January 19, 2021 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the Pub/Sub Lite API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants