Hi,
I'm looking for some feedback regarding making my plugin work in distributed Jenkins (master/slave) setups.
For now I have made a "private static class DeployCallable extends MasterToSlaveCallable<Boolean, InterruptedException>" internal class
with all my code being inside the "public Boolean call() throws InterruptedException" method.
I then just call this method with "launcher.getChannel().call(deployCallable)".
I think current code should work in a distributed Jenkins (master/slave) setup.
I just have one problem, if a user cancels the build from the master my plugin does not get interrupted and still gets executed until the end and only then the job is marked as canceled even tough it still finished doing everything.
Is there anything that I can do? I'm thinking of breaking my "do it all" "DeployCallable" into smaller pieces. Like one DeployCallable class to prepare the build and return a list of folders to be deployed, then another DeployCallable class that will zip one folder and iterate from master over the list returned by the first callable and then call this other Callable to zip one folder at a time, then another DeployCallable class that will upload the zip files and do the same iterate over the list of zips generated by the previous callable and call this Callable for each zip to upload it.
Would this make sense? I think in this case the interrupted exception might work? But my code will be more complicated and ugly.
What are my options? What can I do?
Thank you.