Commit 372c8b61 authored by nik's avatar nik Committed by intellij-monorepo-bot
Browse files

IDEA-CR-52072: jps build: don't try to reuse forked javac process which will...

IDEA-CR-52072: jps build: don't try to reuse forked javac process which will be stopped after current compilation (IDEA-221937)

If parallel compilation is enabled it may happen that build process tries to compile another module using forked process while a different module is still being compiled. Since "keep alive" is set to false for javac processes started from the build process, it shouldn't try to reuse such processes, because it will fail to connect to them anyway and compilation will fail with obscure "internal java compiler error".

(cherry picked from commit 59c41ddaa529322f4d457be1261deb929d8fbda9)

GitOrigin-RevId: 40420e9d9a776f303bf6f39c93cd36f5b101c8e6
parent 32fe3f02
Branches unavailable Tags unavailable
No related merge requests found
Showing with 5 additions and 0 deletions
+5 -0
......@@ -210,6 +210,11 @@ public class ExternalJavacManager extends ProcessAdapter {
synchronized (myRunningProcesses) {
for (Map.Entry<UUID, ExternalJavacProcessHandler> entry : myRunningProcesses.entrySet()) {
final ExternalJavacProcessHandler process = entry.getValue();
if (!process.isKeepProcessAlive()) {
//we shouldn't try to reuse process which will stop after finishing the current compilation
continue;
}
final Integer hash = PROCESS_HASH.get(process);
if (hash != null && hash == processHash) {
return process;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment