disable process preloading in debug mode

This commit is contained in:
Eugene Zhuravlev
2014-12-18 11:54:39 +01:00
parent 39ebe0682e
commit fd6aff1109
@@ -104,7 +104,8 @@ import org.jetbrains.jps.cmdline.ClasspathBootstrap;
import org.jetbrains.jps.incremental.Utils;
import org.jetbrains.jps.model.serialization.JpsGlobalLoader;
import javax.tools.*;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
import java.awt.*;
import java.io.File;
import java.io.IOException;
@@ -734,7 +735,7 @@ public class BuildManager implements ApplicationComponent{
myBuildsInProgress.remove(projectPath);
notifySessionTerminationIfNeeded(sessionId, execFailure);
if (Registry.is("compiler.process.preload") && !project.isDisposed()) {
if (isProcessPreloadingEnabled() && !project.isDisposed()) {
runCommand(new Runnable() {
public void run() {
if (!myPreloadedBuilds.containsKey(projectPath)) {
@@ -763,6 +764,11 @@ public class BuildManager implements ApplicationComponent{
return _future;
}
private static boolean isProcessPreloadingEnabled() {
// automatically disable process preloading when debugging
return Registry.is("compiler.process.preload") && Registry.intValue("compiler.process.debug.port") <= 0 ;
}
private void notifySessionTerminationIfNeeded(UUID sessionId, @Nullable Throwable execFailure) {
if (myMessageDispatcher.getAssociatedChannel(sessionId) == null) {
// either the connection has never been established (process not started or execution failed), or no messages were sent from the launched process.