Uh oh!
There was an error while loading. Please reload this page.
Watchdog: move to client context - #480
Conversation
bbd45c7 to
6aff80bCompareCodecov Report
@@ Coverage Diff @@## master #480 +/- ##
===========================================
+ Coverage 70.33% 70.44% +0.1% - Complexity 775 810 +35
===========================================
Files 163 166 +3 Lines 3668 3776 +108 Branches 273 289 +16 ===========================================
+ Hits 2580 2660 +80 - Misses 973 993 +20 - Partials 115 123 +8
Continue to review full report at Codecov.
|
0af9abf to
91256b6Compareigorbernstein2
commented
Feb 22, 2018
rebased on the latest prep changes |
91256b6 to
5d051cbCompareigorbernstein2
commented
Feb 24, 2018
Rebased. This is ready for review |
garrettjonesgoogle
left a comment
There was a problem hiding this comment.
The change generally looks good.
| import com.google.common.base.Preconditions; | ||
| /** | ||
| * Integration {@link ServerStreamingCallable} for the {@link Watchdog}. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| WatchdogProvider withExecutor(ScheduledExecutorService executor); | ||
| boolean needsExecutor(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| ApiCallContext withTimeout(Duration rpcTimeout); | ||
| /** | ||
| * Returns a new ApiCallContext with the given timeout set. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| Duration getStreamWaitTimeout(); | ||
| /** | ||
| * Returns a new ApiCallContext with the given timeout set. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| @Override | ||
| public ApiCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout) { | ||
| throw new UnsupportedOperationException("Http does not support streaming"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| @BetaApi("The surface for streaming is not stable yet and may change in the future.") | ||
| @Nullable | ||
| public abstract Watchdog getWatchdog(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import javax.annotation.Nullable; | ||
| import org.threeten.bp.Duration; | ||
| public class FixedWatchdogProvider implements WatchdogProvider { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
igorbernstein2
commented
Feb 27, 2018
Incorporated all suggestions, PTAL |
garrettjonesgoogle
left a comment
There was a problem hiding this comment.
LGTM - I will merge after you fix my last tiny requests
| /** | ||
| * Returns a new ApiCallContext with the given timeout set. | ||
| * Returns a new ApiCallContext with the given stream idel timeout set. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| /** | ||
| * Integration {@link ServerStreamingCallable} for the {@link Watchdog}. | ||
| * A callable that uses the {@link Watchdog} to monitor streams. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
just noticed a couple of bugs (I forgot to update the semantics to be nonnull for clientcontext). please don't merge yet |
481ed3b to
93784f2Compareigorbernstein2
commented
Feb 28, 2018
Ok, fixed. The issue was a result of an incomplete rebase on top of the feedback in #482. The fix was to disallow null in CallContext for arguments. But to retain it internally to allow proper merge semantics. @garrettjonesgoogle PTAL |
igorbernstein2
commented
Feb 28, 2018
hmm, that's odd I'm not sure why the verifyLicense check is failing |
garrettjonesgoogle
commented
Feb 28, 2018
We updated license headers in #487 - you'll need to update your files too. |
| Preconditions.checkArgument( | ||
| streamWaitTimeout.compareTo(Duration.ZERO) > 0, "Invalid timeout: <= 0 s"); | ||
| } | ||
| public GrpcCallContext withStreamWaitTimeout(@Nonnull Duration streamWaitTimeout) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Add {Fixed,Instantiating}WatchdogProviders to allow for transitioning from built ClientContexts to StubSettings.Builders and ClientContext.Builders
- Mark the Watchdog as nullable to keep backwards compatibility (to avoid NPEs building ClientContexts from Builders)
- Allow StubSettings to configure both the WatchdogProvider and the WatchdogCheckInterval.
- Enable the watchdog in StubSettings by default with an interval of 10 secs.…erStreamingCallable from the Watchdog
2560777 to
2a9c71aCompareigorbernstein2
commented
Feb 28, 2018
updated: licenses fixed & allowing users to clear timeouts. PTAL |
This depends on #482, which handles preliminary refactoring to cut down on the noise in this PR.
This is a follow up on the watchdog introduced in #463. It moves it out of the
RetryingServerStreamingCallableand into theClientContext. The main benefits are:Changes: