Skip to content

Conversation

stuebingerb
Copy link
Owner

@stuebingerb stuebingerb commented Jun 22, 2025

Adds proper handling for dataProperties to ParallelRequestExecutor and gets rid of DataLoaderPreparedRequestExecutor, along with the option to configure the request executor in SchemaConfiguration and related DataLoaderPreparedRequestExecutor-specific options.

This also consolidates some tests that were hardcoded to use one of the request executors, and therefore missed the other, and extends coverage for dataProperties a bit. Further, this reduces visibility of some functions to internal to reduce namespace pollution.

Resolves #58
Resolves #268

BREAKING CHANGE: The option to configure request executors has been removed, and execution will now always use the ParallelRequestExecutor.
BREAKING CHANGE: The option to configure a timeout has been removed, as it was only respected by DataLoaderPreparedRequestExecutor.
BREAKING CHANGE: The possibility to pass ExecutionOptions to schema execution has been removed, as it was only respected by DataLoaderPreparedRequestExecutor.
BREAKING CHANGE: The DataLoaderPreparedRequestExecutor, Executor, and ExecutionOptions classes have been removed.

@stuebingerb stuebingerb force-pushed the refactor/remove-dataloaderprepared-executor branch from 42d0244 to 9d37255 Compare June 22, 2025 13:26
@stuebingerb
Copy link
Owner Author

stuebingerb commented Jun 22, 2025

This feels way too easy but there seems to be only one test that actually validates DataLoader specifics (DataLoaderTest#data loader cache per request only).

Already open for review but I want to have a bit more test coverage.

Edit: basic data loader validates as well but I still feel like I'm missing something.

Copy link

codecov bot commented Jun 22, 2025

Codecov Report

❌ Patch coverage is 92.13483% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.32%. Comparing base (1cb755d) to head (0d499f8).

Files with missing lines Patch % Lines
...raphql/schema/execution/ParallelRequestExecutor.kt 93.24% 0 Missing and 5 partials ⚠️
...n/com/apurebase/kgraphql/schema/execution/Merge.kt 81.81% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   76.20%   77.32%   +1.12%     
==========================================
  Files         155      152       -3     
  Lines        5047     4843     -204     
  Branches      896      843      -53     
==========================================
- Hits         3846     3745     -101     
+ Misses        861      781      -80     
+ Partials      340      317      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stuebingerb
Copy link
Owner Author

Removing the one request executor that already works with kotlinx.serialization seems bad for #224 but my gut feeling is that this would still be a step in the right direction. Both executors have diverged and I believe it is easier to migrate the existing one than solving existing issues with DataLoaderPreparedRequestExecutor and adding missing functionality there. Feel free to disagree, though, happy to have a discussion.

@stuebingerb stuebingerb force-pushed the refactor/remove-dataloaderprepared-executor branch from 9d37255 to 7b2d851 Compare August 26, 2025 15:59
@stuebingerb stuebingerb changed the title refactor!: remove DataLoaderPreparedRequestExecutor feat!: support dataProperty with ParallelRequestExecutor Aug 26, 2025
@stuebingerb
Copy link
Owner Author

Back with some more test coverage and an implementation that looks a bit more promising, albeit not very polished.

@stuebingerb stuebingerb marked this pull request as ready for review August 27, 2025 08:13
@stuebingerb
Copy link
Owner Author

That might be an issue. Just sharing it here for now as I'm not sure if I am able to analyze further before my absence:

jvm summary:
Benchmark                                  (withNewExecutor)  (withSuspendResolvers)  Mode  Cnt  Score    Error  Units
ParallelExecutionBenchmark.queryBenchmark               true                    true  avgt    5  0,015 ±  0,001   s/op
ParallelExecutionBenchmark.queryBenchmark               true                   false  avgt    5  3,762 ±  0,035   s/op
ParallelExecutionBenchmark.queryBenchmark              false                    true  avgt    5  0,009 ±  0,001   s/op
ParallelExecutionBenchmark.queryBenchmark              false                   false  avgt    5  0,314 ±  0,005   s/op

"withNewExecutor" either selects the ParallelRequestExecutor of this PR or the code from the commit before.

@stuebingerb
Copy link
Owner Author

Better. Just needs a bit more polishing than before:

jvm summary:
Benchmark                                  (withNewExecutor)  (withSuspendResolvers)  Mode  Cnt  Score    Error  Units
ParallelExecutionBenchmark.queryBenchmark               true                    true  avgt    5  0,006 ±  0,001   s/op
ParallelExecutionBenchmark.queryBenchmark               true                   false  avgt    5  0,315 ±  0,002   s/op
ParallelExecutionBenchmark.queryBenchmark              false                    true  avgt    5  0,010 ±  0,001   s/op
ParallelExecutionBenchmark.queryBenchmark              false                   false  avgt    5  0,310 ±  0,002   s/op

@stuebingerb stuebingerb force-pushed the refactor/remove-dataloaderprepared-executor branch 2 times, most recently from 0c61053 to be38453 Compare September 1, 2025 14:14
Adds proper handling for `dataProperties` to `ParallelRequestExecutor`
and gets rid of `DataLoaderPreparedRequestExecutor`, along with the
option to configure the request executor in `SchemaConfiguration` and
related `DataLoaderPreparedRequestExecutor`-specific options.

This also consolidates some tests that were hardcoded to use one of
the request executors, and therefore missed the other, and extends
coverage for dataProperties a bit. Further, this reduces visibility of
some functions to `internal` to reduce namespace pollution.

Resolves #58
Resolves #268

BREAKING CHANGE: The option to configure request executors has been
removed, and execution will now always use the `ParallelRequestExecutor`.
BREAKING CHANGE: The option to configure a timeout has been removed,
as it was only respected by `DataLoaderPreparedRequestExecutor`.
BREAKING CHANGE: The possibility to pass `ExecutionOptions` to schema
execution has been removed, as it was only respected by `DataLoaderPreparedRequestExecutor`.
BREAKING CHANGE: The `DataLoaderPreparedRequestExecutor`, `Executor`,
and `ExecutionOptions` classes have been removed.
@stuebingerb stuebingerb force-pushed the refactor/remove-dataloaderprepared-executor branch from be38453 to 0d499f8 Compare September 1, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate request executors Take over or replace DeferredJsonBuilder
1 participant