-
Notifications
You must be signed in to change notification settings - Fork 12
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 client_wait_for_response option to some method calls #222
Conversation
709d8b9
to
b60c2ff
Compare
I've also added the |
Ok, this does not work IRL, though I think I know what I've got to do to fix it, so don't bother testing quite yet... |
What commands are we going to issue as |
Currently the only one planned is |
b60c2ff
to
d8ace12
Compare
Ok it works now, but when used in this way it emits a bunch of log events to the effect that the request failed. Which it kinda didn't. I'll see what I can do. |
a2e1fe8
to
033711c
Compare
This works "fully" now, only through a lot of investigation into what exceptions |
I will try and make some time today to test this out locally (with the corresponding API branch). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - have tested this locally, let's try it 👍
this controls whether the api's endpoint *itself* waits for its daisychained call to the search api to complete before responding to our call
033711c
to
a9ed908
Compare
This is a part of a potential way of addressing https://trello.com/c/LABe8BKA
The pattern it introduces is something I like to call async-not-async. It's simply allows a user of the
apiclient
to perform a highly simplified form of async http request by ignoring the response from the server. It does this by setting the read timeout to something tiny and allowing that timeout to happen. It relies on the fact that web server stacks tend not to readily propagate "the client is gone" information, and a request will continue to be processed fully, even after the client has given up.In the case we're proposing to use it it gives us basically all the advantages of true async but also all the perils: how easy it is to launch hundreds of requests in a couple of milliseconds without considering how the recipient will deal with it. Pushed too far, what we'd effectively end up doing is using our http servers' connection buffers as a not-very-good task queue, which could lead to healthcheck failures.
Why prefix the kwarg with
client_
? Because previously all arguments passed to apiclient methods implied they were referring to server options. This is the first relating to client behaviour, and the distinction could start to get ambiguous if and when we start doing things like adding a server-side option to theapi
'supdate_service
endpoint to instruct it to perform its daisychainedindex
request to thesearch-api
without waiting for the response.