tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.18k stars 209 forks source link

bug: Tailcall with deduplication doesn't respond after making multiple concurrent requests #2276

Closed beelchester closed 2 days ago

beelchester commented 6 days ago

Prerequisites

Describe the bug

On dedupe:true, If I make multiple concurrent n+1 query requests It doesn't respond.

Steps to reproduce

  1. Open codespace on https://github.com/tailcallhq/graphql-benchmarks
  2. use dedupe: true in graphql/tailcall/benchmark.graphql
  3. run the ./run.sh script or tailcall start benchmark.graphql (for better logs)
  4. In wrk/wrk.lua change wrk.body to '{"operationName":null,"variables":{},"query":"{posts{id,userId,title,user{id,name,email}}}"}'
  5. run ./wrk/bench.sh.

Expected behavior

Tailcall should respond and the benchmarks should work all the time.

Actual behavior

On the first run of ./wrk/bench.sh it might work correctly but try running it 2-3 more times. It doesn't respond and the benchmark shows all 0

Screenshots

https://github.com/tailcallhq/tailcall/assets/73148455/7905b2de-45f0-419e-ad58-ef873ae772c3

Environment information:

Additional context

I'm working on https://github.com/tailcallhq/graphql-benchmarks/pull/258

bnchi commented 6 days ago

For me this showed up at the 3rd run of ./wrk/bench.sh but then I restarted the server and tried to reproduce the issue and couldn't do it

Screen Shot 2024-06-24 at 1 38 59 PM

Using 4 core 16GB RAM codespace

meskill commented 4 days ago

I've prepared a fix https://github.com/tailcallhq/tailcall/pull/2291 for this.

You can try it to see if it fixes the issue for you.

beelchester commented 4 days ago

Yes, it has fixed the issue for me. Thanks!