You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix race condition in ScalaCompile by selectively interrupting futures with Thread.interrupt
Prior to this change there was a bug when ScalaCompile actions were used
with dynamic execution. The bug would cause builds to fail with the
error message "compiler mirror not found". It is my understanding this
message typically indicates a problem loading the Scala Library jar
during compilation.
The error would always occur in the local multiplex worker's logs and
not the remote logs.
This commit fixes this error by not using Thread.interrupt when
cancelling the future running the ScalaCompile action.
My hypothesis on why this error occurs is as follows: imagine one of the
classloaders in the shared ScalaInstance is in use on Thread A. That
thread gets cancelled and interrupted via Thread.interrupt. This causes
some kind of persistent error inside either the classloader or another
part of Zinc or the Scala compiler. We correctly ignore the error on
Thread A because the request it was handling was cancelled. Another
thread is working a non-cancelled request, it uses that same
ScalaInstance, hit that persistent error, and fails.
By not using Thread.interrupt we don't trigger the persistent error and
thus avoid the bug.
0 commit comments