Conversation
|
CI performance tests
|
|
it looks like there's some flakiness in the tests with the snapshots https://app.circleci.com/pipelines/github/apollographql/router/23631/workflows/0230bc91-f65c-47a1-ae33-6128fae26325/jobs/165914?invite=true#step-117-361965_43 |
|
There is indeed an on-going something or another in the tests. @BrynCooke did try to look at this today, but will not be around for the next couple weeks, and I'm not sure will get back to it. I will highlight that there is still conversation that wasn't answered from the original PR that might be worth discussing: @xuorig wrote:
|
As per the extensive commentary here: https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.or_current Let's see if this fixes things.
They should be the same as in dev.
Not sure exactly what is happening here, but ...
This might be the solution I've been looking for. Make sure to create the spawn outside of the call to spawn_blocking.
|
Thanks @garypen for finishing that one |
|
This PR is causing some tests to flake at a somewhat pronounced rate. We believe it's just actually the tests, or the way we tested, but we'll revert this for now. |
The parsing and validation step is a blocking task that can be expensive on large queries. When performed on a tokio executor threads, that thread is unavailable to handle other asynchronous requests in the mean time. Which means that if a lot of large queries come in at once, they could lock up all of the executor threads, and the router then stops handling traffic. This moves parsing validation in tokio's blocking tasks pool. This is a set of threads allocated purely to blocking tasks, exposing an async interface for the rest of the code, so executor threads can offload the parsing there then go back to the rest of the traffic while the query is parsed. If too many large queries come in at once, the blocking pool might get temporarily used entirely, but this will not affect traffic for other queries that were already parsed and planned, and the request handling timeout can trigger if it waits too long for its query to be parsed. Co-authored-by: Marc-Andre Giroux <mgiroux@netflix.com> Co-authored-by: Marc-Andre Giroux <mgiroux0@gmail.com>
This leverages the work that @xuorig started in #5235 with a number of necessary follow-up fixes to get it into the shape we'll need to land it.
I have checked manually that the span duplication in the snapshot has no impact on traces reported to aggregators, it's more of an artifact of our way to gather spans in the test.
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩