Conversation
This reverts commit 91f1967.
…to cancel-support-attempt-2
Test Results 318 files 318 suites 2m 39s ⏱️ Results for commit 9cb1c71. ♻️ This comment has been updated with latest results. |
This comment was marked as outdated.
This comment was marked as outdated.
…mpt-2 # Conflicts: # src/main/java/graphql/execution/AbstractAsyncExecutionStrategy.java # src/main/java/graphql/execution/AsyncExecutionStrategy.java # src/main/java/graphql/execution/AsyncSerialExecutionStrategy.java # src/main/java/graphql/execution/ExecutionContext.java # src/main/java/graphql/execution/ExecutionStrategy.java # src/main/java/graphql/execution/SubscriptionExecutionStrategy.java # src/test/groovy/graphql/execution/ExecutionContextBuilderTest.groovy
| @Nullable | ||
| private volatile ExecutionId executionId; | ||
|
|
||
| private final AtomicInteger isRunning = new AtomicInteger(0); |
|
|
||
| private final AtomicInteger isRunning = new AtomicInteger(0); | ||
|
|
||
| @VisibleForTesting |
There was a problem hiding this comment.
killed this - tests now create a valid one
| } | ||
| //noinspection DataFlowIssue | ||
| return fn.apply(t, throwable); | ||
| }); |
There was a problem hiding this comment.
idea was giving it a yellow line
| this.executionId = executionId; | ||
| public void updateExecutionInput(ExecutionInput executionInput) { | ||
| this.executionInput = executionInput; | ||
| this.executionId = executionInput.getExecutionId(); |
There was a problem hiding this comment.
we now can change the execution input
| void throwIfCancelled() throws AbortExecutionException { | ||
| engineRunningState.throwIfCancelled(); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
These are just helper methods to make it nicer inside the ExecutionStrategies
|
|
||
| private BiConsumer<List<Object>, Throwable> buildFieldValueMap(List<String> fieldNames, CompletableFuture<Map<String, Object>> overallResult, ExecutionContext executionContext) { | ||
| return (List<Object> results, Throwable exception) -> { | ||
| exception = executionContext.possibleCancellation(exception); |
There was a problem hiding this comment.
This does a trick - if the Throwable is already set - leave it set - otherwise check if we are cancelled and make the throwable be that
| .engineRunningState(new EngineRunningState()) | ||
| .engineRunningState(new EngineRunningState(ei)) | ||
| .build() | ||
| ExecutionStrategyParameters executionStrategyParameters = ExecutionStrategyParameters |
There was a problem hiding this comment.
Made it a valid EngineRunningState not a test one
…mpt-2 # Conflicts: # src/main/java/graphql/execution/EngineRunningObserver.java
…to cancel-support-attempt-2
…mpt-2 # Conflicts: # src/main/java/graphql/execution/ExecutionContext.java
…mpt-2 # Conflicts: # src/test/groovy/graphql/execution/SubscriptionExecutionStrategyTest.groovy
This is related to #3879
This is the second attempt at operation cancellation.
This now uses the new
graphql.EngineRunningStateas the place to hold the ExecutionInput an check if its cancelled.The execution engine code now calls into to check
There are some helpers on execution context as well for