You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop retrying get-workflow-history with an impossibly-short timeout (#1171)
* Stop retrying get-workflow-history with an impossibly-short timeout
Previously, when a `GetWorkflow(...).Get(...)` call timed out while waiting
for the workflow to complete, this happened:
- N-1 requests of the default long-poll timeout occurred, and it correctly retried
- The final request would have something like 5 seconds left, so it performs that call
- The server gives up the request *slightly before* that timeout so it can return the
next page token for a future request to use (as happened in the N-1 earlier requests)
- Since no history was received and there's still time left in the context (~50ms
internally), another impossibly-short request was sent
- This request fails immediately with a "insufficient time for long poll request" error.
- *This bad-request error* is what is returned from `Get(...)`
Which is pretty clearly sub-optimal.
Both because we sent a request that is almost guaranteed to fail, and because the error
returned to the caller is fairly generic looking / doesn't describe what happened.
What happened is that we ran out of time.
So this now returns a DeadlineExceeded error, like any other timeout, and does not
cause that final request to occur.
History: &shared.History{Events: nil}, // this or RawHistory must be non-nil, but they can be empty
309
+
NextPageToken: []byte{1, 2, 3, 4, 5},
310
+
}
311
+
reqFinal.NextPageToken=resEmpty.NextPageToken
312
+
313
+
s.True(time.Second< (defaultGetHistoryTimeoutInSecs*time.Second), "sanity check: default timeout must be longer than how long we extend the timeout for tests")
314
+
315
+
// begin with a deadline that is long enough to allow 2 requests
0 commit comments