Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Watchdog is internal but uses aren't #829

Closed
elharo opened this issue Dec 12, 2019 · 10 comments
Closed

Watchdog is internal but uses aren't #829

elharo opened this issue Dec 12, 2019 · 10 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. semver: minor A new feature was added. No breaking changes. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@elharo
Copy link
Contributor

elharo commented Dec 12, 2019

Watchdog is marked internal but various places that use it aren't. e.g. gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java

@InternalApi
public class Watchdog implements Runnable 

Internal APIs should only appear on the surface of other internal APIs.

@elharo elharo added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. semver: minor A new feature was added. No breaking changes. labels Dec 12, 2019
@igorbernstein2
Copy link
Contributor

This is blocked on refactoring of ClientContext. I think ClientContext is supposed form the core of an autogenerated stub and contains stateful things like channels, credentials, executor, and the watchdog. This class is currently part of the public api, so unless that class becomes internal or another mechanism is introduced to store internal state, I don't really have a way forward.

@igorbernstein2
Copy link
Contributor

Everything related to the watchdog is either internal or beta, so we are pretty safe. However I don't think that this is p1 bug, as I mentioned earlier, the cleanup does happen by side effect.

@elharo
Copy link
Contributor Author

elharo commented Dec 12, 2019

@beta != @internal and the same class can be marked as both.
This is pretty important or we're going to get locked into APIs we don't want and can't change. If we don't fix this now, we might well never be allowed to.

@igorbernstein2
Copy link
Contributor

I agree that this should be fixed before we remove the Beta api labels. However since no one has expressed time pressure for removing the labels and since this doesn't have negative effects on current users, I don't think fixing this should pre-empt existing priorities.

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Dec 17, 2019
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Dec 27, 2019
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jan 7, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jan 17, 2020
@hkdevandla
Copy link
Member

Hi Hanzhen, can you please take a look at this? Thanks!

@yihanzhen
Copy link
Contributor

Okay this is an awkward situation here...

Ideally as what @elharo has described we should have marked Watchdog as both @BetaApi and @InternalApi, and remove @InternalApi once ClientContext starts to expose it on the surface.

How bad would it be if we change Watchdog from @InternalApi to BetaApi?

Or rather, @igorbernstein2 how is Watchdog used from ClientContext? Is it only used by BigTable? How bad would it be if we remove the methods that expose Watchdog?

@igorbernstein2
Copy link
Contributor

End users should not interact with the Watchdog directly. End users are supposed to configure settings for the Watchdog via StubSettings#setStreamWatchdogCheckInterval. And the Watchdog is created internally by the client. I don't really see how you can remove the watchdog methods from ClientContext since the watchdog is needed by GrpcCallableFactory to create callable chains and there should be only 1 instance of the Watchdog per client. ClientContext encapsulates client scoped objects.

The watchdog is not Bigtable specific and is used for all server streaming grpc calls:
https://github.com/googleapis/gax-java/blob/master/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java#L304

Classes like FixedWatchdogProvider should be definitely marked Internal as well. I also think that ClientContext should also be marked Internal since it's only role is encapsulate internal client state.

@yihanzhen
Copy link
Contributor

Thanks @igorbernstein2 . Can we get away with marking these classes as internal without a major bump? Or, is there any formal process for such breaking changes as making a public stable class internal (like deprecating a method or class) until we are ready for the next major version?

@igorbernstein2
Copy link
Contributor

You can mark the WatchdogProvider implementations as Internal since they are BetaApi. However ClientContext is GA, so I don't think you can change that.

Also, please note that I don't have decision powers on the gax changes. I think someone from the actools team would be a better candidate for discussing the direction of the api surface. I'm mainly a consumer of the library for bigtable.

@yihanzhen
Copy link
Contributor

Hey @vam-google can you weigh in?

@AlanGasperini AlanGasperini added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 24, 2020
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Feb 24, 2020
@yihanzhen yihanzhen assigned vam-google and unassigned yihanzhen Apr 10, 2020
vam-google added a commit to vam-google/gax-java that referenced this issue Jun 4, 2020
…ns `@InternalApi`

This is to address googleapis#829.

Also add grpclb lib to bazel dependencies, as its absence was failing some of the tests well executing from bazel.
vam-google added a commit that referenced this issue Jun 5, 2020
…@InternalApi` (#1119)

This is to address #829.

Also add grpclb lib to bazel dependencies, as its absence was failing some of the tests well executed from bazel.

This  PR basically repeats #881, with few more things in it (like making watchog final, as requested in the review there)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. semver: minor A new feature was added. No breaking changes. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants