Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

Prevent interrupt/kill from leaving broken cache #184

Closed niloc132 closed 2 years ago

niloc132 commented 2 years ago

This pull request applies the three basic suggestions from #121, to ensure that a stopping process will either clean up after itself, or that other processes can detect a stale cache and cancel the work, start over.

This doesn't go so far as to cancel in-progress work, to permit watch mode to more quickly start a new build, but it should make this easier to write.

Testing process should include gracefully halting a build, halting it abruptly (i.e. kill -9), and testing that both a new process can start up and take over, or that a second process running in parallel can take over the cache correctly. Because this is an issue wracked with potential race conditions, many tests should be run to ensure that this is working correctly.

Fixes #121

niloc132 commented 2 years ago

Bug still present: with two processes running, if one fails to completely clean its own canceled task, the other may not discover it to be stale. Presently planning to defer this to a later patch, and just address one process at a time.

treblereel commented 2 years ago

Bug still present: with two processes running

@niloc132 two processes running on the same project ? does it makes sence ?