Skip to content

Commit 629f4c4

Browse files
authored
fix: overhaul of server streaming retries (#1653)
* fix: reduce duplicate code in streaming retries and add a test * add comments * WIP experiment * experiments * WIP - loss example * fix typo, use pipe not pumpify * example of piping errors together * pipeline example * experiment continued * no buffer, data loss * stream pipeline example * example that shows before and after * set immediate exampel * call both tests * another scenario * more experiment * more experimentation * more experimenting * some reorganization * more experiments * WIP: more exampels * WIP * WIP: fixing tests * move streamingRetryRequest to streaming.ts, remove delayStream * WIP - move SRR into streamProxy class * WIP - reduce duplicate code between forwardEventsREtries and streamingErrorhanodffhandler * WIP - exploration of SRR removal * merge with cbt2 * fix mistake from rebase * wip - remove bind from non error emit * WIP - stream retries pipeline - success case * WIP - redoing SRR, successful calls * wip - redoing retries, fails immediately * WIP - some retrying * WIP - theoretically working * some test cleanup * WIP * WIP * WIP - resetting retries to zero * change .end to .destroy * Working version of new retries * linted test app * WIP - no lint errors, but lots commented out * cleanup * remove files that shouldn't be here * remove files * remove protos that don't need to be there * remove more files * remove text files * more cleanup * remove more files * remove old directories * finish file cleanup * more cleanup * fix one unit test * fix some unit tests * revert previous change * fix some unit tests * fix another unit test * fix one more unit test * WIP - event forwarding is working! * fix test behavior - move data push inside of case * WIP - fixing shouldRetry test * fix another unit test * fix another unit test * fix two more tests * fix more unit tests, remove console logs * WIP - trying final test again * add a lil stream destruction * WIP - update returns in inner function * remove return * add status/end boolean, remove retrying boolean * some testing fixes * more fixes * lots of lint fixes * fix todos, fix test behavior * some lint fixes, some todo cleanups * resolve some todos * add a test, todo cleanup * WIP - timeout stuff * Timeout test * lint fixes * remove retries param * helper function * resolving todos * resolve lint * clean up tests * final fix of tests * re-add accidentally deleted file * remove erroneous print statement * private function * address review comment * fixing docstring * fix lint * add comments in test * type coercion change * resolve review comment * better typing in unit tests * fix lint * fix - make sure package.json matches main * try/catch for timeout test * fix lint
1 parent 564e9e7 commit 629f4c4

File tree

7 files changed

+2278
-792
lines changed

7 files changed

+2278
-792
lines changed

gax/src/gax.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ export function convertRetryOptions(
386386
// this is in seconds and needs to be converted to milliseconds and the totalTimeoutMillis parameter
387387
if (options.retryRequestOptions.totalTimeout !== undefined) {
388388
totalTimeoutMillis = options.retryRequestOptions.totalTimeout * 1000;
389+
} else {
390+
if (options.maxRetries === undefined) {
391+
totalTimeoutMillis = 30000;
392+
warn(
393+
'retry_request_options_no_max_retries_timeout',
394+
'Neither maxRetries nor totalTimeout were passed. Defaulting to totalTimeout of 30000ms.',
395+
'MissingParameterWarning'
396+
);
397+
}
389398
}
390399

391400
// for the variables the user wants to override, override in the backoff settings object we made

0 commit comments

Comments
 (0)