Skip to content
\n

I'm not seeing the \"cancel\" signal being propagated up the chain and my DataFetcher is not cancelled as a result.
\nI think #75 is somewhat related, but I'm wondering if this is the expected behavior or if I can implement a custom component to achieve that goal. Is the message lost in the AsyncExecutionStrategy?

\n

For background, Spring for GraphQL is trying to provide/document an interceptor for timeouts, but it seems that the \"cancel\" signal is lost along the way in GraphQL. This defeats a bit the purpose, as there is no way to cancel expensive calls if the execution has been cancelled.

","upvoteCount":2,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

I am not an expert in Future cancellation but I was under the impression that CompletableFuture does NOT propagate a signal upwards to stop a chained CF

\n

re: elements from https://stackoverflow.com/questions/65539126/whats-the-intended-pattern-of-canceling-already-running-completablefutures

\n

and

\n

https://nurkiewicz.com/2015/03/completablefuture-cant-be-interrupted.html

\n

I did some local testing and chained CFs do not interrupt.

\n

It would take a library like say https://github.com/vsilaev/tascalate-concurrent and its \"dependent promises\" for this to happen I suspect.

\n

But if I am wrong here I am happy to be corrected and guided.

","upvoteCount":1,"url":"https://github.com/graphql-java/graphql-java/discussions/3691#discussioncomment-10447699"}}}
Discussion options

You must be logged in to vote

I am not an expert in Future cancellation but I was under the impression that CompletableFuture does NOT propagate a signal upwards to stop a chained CF

re: elements from https://stackoverflow.com/questions/65539126/whats-the-intended-pattern-of-canceling-already-running-completablefutures

and

https://nurkiewicz.com/2015/03/completablefuture-cant-be-interrupted.html

I did some local testing and chained CFs do not interrupt.

It would take a library like say https://github.com/vsilaev/tascalate-concurrent and its "dependent promises" for this to happen I suspect.

But if I am wrong here I am happy to be corrected and guided.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@bbakerman
Comment options

@bbakerman
Comment options

@bclozel
Comment options

@bbakerman
Comment options

@bclozel
Comment options

Answer selected by bclozel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants