On Wed, Mar 21, 2018 at 7:12 AM, Daniel Anechitoaie <[email protected]> wrote: > [Is it] possible maybe one of these libraries? […] > > I tried a test with just a bunch of Thread.sleep() before it gets to my code > (that zips the files and HTTP puts them) and if I cancel the job there it > gets aborted nicely and is handled properly by Jenkins.
So sounds like a problem in the interaction between the behavior of those libraries and Jenkins interrupt handling. Again I suspect that something is catching interrupts, proceeding without throwing `InterruptedException`, but then setting the thread interrupt flag and this gets ignored up until the moment the build record is being finalized and the NIO calls made from `AtomicFileWriter` check the flag. If true, the solution would probably be for the code which runs an individual build step (somewhere in `AbstractBuild` IIRC) to check the interrupt flag and throw `InterruptedException` at that time. Could be verified in a `JenkinsRule`-based test by having a `TestBuilder` which mimics the relevant behavior of these libraries. I doubt this particular issue could apply to Pipeline builds, though there might be other ways in which interrupt handling is incorrect there as well. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1G3%3DVt28Y2pXupBTUVdsw-D%3DOBpkqv-%3Dw4sTtdoxsOyg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
