-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add :timeout and :deadline options #428
Comments
What would As for retries, it's hard. Do you want to yell at people if they use a total timeout that is potentially incompatible with the retries they've specified, for example? |
RE :deadline, yeah, exactly. One example is RE retry, good question. I'd keep it orthogonal and dumb, i.e. once we make retries opt-in (#383) I'd like to have a shorthand like |
Yeah it probably is reasonable enough. 🙃 Sounds good. |
Come to think of it, I suppose we'd need to add a caveat (similar to the one from Finch :request_timeout) that this would be a best effort timeout/deadline and if someone needs a guarantee they should use async/await. Best effort as in we'd pass timeout/deadline to calls that support them (I/O) but otherwise I don't think we want to, for example, check timeout/deadline before running each step. Or maybe we should just wrap it in async/await ourselves and document we're doing so and thus there's extra data copying, though I'd really rather avoid that. |
Yeah good point, the steps can add to the total timeout. Maybe I’m thinking this: we can add a timeout to Req that translates to the actualy network timeout (so the same as the Finch one). Then, we don't add |
Thanks, sending the response back to the caller bypassing async process so to speak is interesting, I can look into that. But yeah I think we either do a :timeout using async/await or we don't and just call it :network_timeout/:request_timeout/etc. In other words we don't do a :timeout that does not have a strong guarantee. The former, timeout with async/await, is definitely more compelling if we can swing it in efficient way, have errors with stack traces etc. |
The idea is for something like this:
to be as close as possible to:
I think under the hood we'd do some bookkeeping around Finch connect timeout and request_timeout (I believe it's a mix of pool_timeout and receive_timeout). We need to make sure it works on HTTP/2 too.
There's some ambiguity around retries, whether :timeout should be per retryable request or for the whole pipeline. Per snippet above I believe it should the latter, one timeout for entire pipeline. I think for :deadline it will pretty obviously be the entire pipeline too so there's an argument that :timeout and :deadline should be equivalent, just two different ways to encode the same things.
WDYT @whatyouhide?
The text was updated successfully, but these errors were encountered: