playframework/Play20 — pull request #590 by jroper (2012-12-04 04:31:12+00:00)
Title: [#641] Synchronized access to presentation compiler used by template compiler

SBT by default compiles sub projects in parallel (unless they are dependent on each other). This meant template compilation was done in parallel, and template compilation uses a single global presentation compiler instance, which is not thread safe. The effect of this was intermittent FreshRunReq exceptions being thrown, as reported here:

https://play.lighthouseapp.com/projects/82401/tickets/641-202-sbt-play-project-intermittent-compile-error-with-freshrunreq

For more details, read my post and the replies by Mark on the SBT mailing list:

https://groups.google.com/d/topic/simple-build-tool/UDqhjNaC1o0/discussion

My solution is to simply synchronize all access to the presentation compiler. This won't have any noticeable impact on single projects, I'm not sure about multi projects, but I suspect it won't be a big impact either.