IDEA-168766 Debugged process hangs during hot-swapping with yourkit agent - workaround, disabled by default

This commit is contained in:
Egor.Ushakov
2017-03-27 14:38:09 +03:00
parent d6c5714dc0
commit f2a13d46ff
2 changed files with 9 additions and 0 deletions
@@ -27,6 +27,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.StringBuilderSpinAllocator;
import com.intellij.util.concurrency.Semaphore;
import com.intellij.util.ui.MessageCategory;
@@ -42,6 +43,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;
/**
* @author lex
@@ -113,6 +115,12 @@ class ReloadClassesWorker {
//virtualMachineProxy.suspend();
if (Registry.is("debugger.resume.yourkit.threads")) {
virtualMachineProxy.allThreads().stream()
.filter(t -> t.isSuspended() && t.name().startsWith("YJPAgent-"))
.forEach(t -> IntStream.range(0, t.getSuspendCount()).forEach(i -> t.resume()));
}
try {
RedefineProcessor redefineProcessor = new RedefineProcessor(virtualMachineProxy);
@@ -261,6 +261,7 @@ debugger.intern.string.literals=false
debugger.intern.string.literals.description=Make string literal refer to the same instance of class String
debugger.capture.points=true
debugger.capture.points.annotations=false
debugger.resume.yourkit.threads=false
analyze.exceptions.on.the.fly=false
analyze.exceptions.on.the.fly.description=Automatically analyze clipboard on frame activation,\