There are something that you can make further investigation:
About the CancelChecker
So, as you can see, In GradleBuildServer.java a lot of request handling method has already passed an argument cc, which is the cancel checker. Ideally, when the client sends a cancel request to the server, we should be able to be notified that via the cancel checker. This capability should be provided by the underlying lsp4j.jsonrpc library. I haven't tested it yet, so this is something that you can take a look maybe. If's it's working as expected, than we can let the cancel checker as another parameter for all those request handling method. And check it when necessary. (I'm not sure that check it regularly in another thread is a good idea, do you have any reference for this approach?)
About cancel the task executed in Gradle Daemon
When we use gradle tooling api to let Gradle daemon do some task for us, Gradle TAPI also supports cancellation.
Please keep in mind that the Gradle build server and Gradle Daemon are running in two different process. If we just simply cancel the request at Gradle build server side, but not notify the cancellation to the Gradle Daemon. The computation resources are still wasted.
So we need to figure out a way to establish kind of connection between:
the cancel checker ( makes sure that is working as expected)
Hi @Sidhaarthsr,
There are something that you can make further investigation:
About the CancelChecker
So, as you can see, In
GradleBuildServer.java
a lot of request handling method has already passed an argumentcc
, which is the cancel checker. Ideally, when the client sends a cancel request to the server, we should be able to be notified that via the cancel checker. This capability should be provided by the underlyinglsp4j.jsonrpc
library. I haven't tested it yet, so this is something that you can take a look maybe. If's it's working as expected, than we can let the cancel checker as another parameter for all those request handling method. And check it when necessary. (I'm not sure that check it regularly in another thread is a good idea, do you have any reference for this approach?)About cancel the task executed in Gradle Daemon
When we use gradle tooling api to let Gradle daemon do some task for us, Gradle TAPI also supports cancellation.
Please keep in mind that the Gradle build server and Gradle Daemon are running in two different process. If we just simply cancel the request at Gradle build server side, but not notify the cancellation to the Gradle Daemon. The computation resources are still wasted.
So we need to figure out a way to establish kind of connection between: