graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Adds the limit for the deferred stream's queue size

Open vdeweb opened this issue 1 year ago • 7 comments

Fixes the issue with streaming: if the rate of consuming data by the client is slower than the rate of streaming data by the server, the server prefetches too much data from the source.

Proposed solution is to limit the queue size (size of the result buffer) in DeferredWorkState.

Changes:

  • size of the queue in DeferredWorkState has a limit now;
  • action of registering DeferredExecutionTask is unbound from its starting with new TaskDispatcher class;
  • previous DeferredExecutionTask has to complete before starting the new one in DeferredStream.

vdeweb avatar Jan 24 '24 17:01 vdeweb

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jan 24 '24 17:01 CLAassistant

Codecov Report

Attention: 25 lines in your changes are missing coverage. Please review.

Comparison is base (acffe7b) 73.15% compared to head (0decfd5) 73.13%. Report is 4 commits behind head on main.

Files Patch % Lines
...te/Core/src/Execution/Processing/DeferredStream.cs 0.00% 8 Missing :warning:
...escriptors/Conventions/XmlDocumentationProvider.cs 0.00% 8 Missing :warning:
...Core/src/Execution/Processing/DeferredWorkState.cs 81.25% 3 Missing :warning:
...cyInjection/InternalServiceCollectionExtensions.cs 75.00% 2 Missing :warning:
.../src/Execution/Processing/DeferredWorkScheduler.cs 66.66% 2 Missing :warning:
...Execution/Processing/Tasks/ResolverTask.Execute.cs 0.00% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6852      +/-   ##
==========================================
- Coverage   73.15%   73.13%   -0.02%     
==========================================
  Files        2499     2499              
  Lines      126162   126170       +8     
==========================================
- Hits        92292    92273      -19     
- Misses      33870    33897      +27     
Flag Coverage Δ
unittests 73.13% <55.35%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 24 '24 17:01 codecov[bot]

We still have this on the back log. I will soon start work on the defer / stream part and then we will have a look at this.

michaelstaib avatar Mar 03 '24 11:03 michaelstaib