Netty channel id init is not reliable yet

IDEA-124411 Netty network stuck in external make process
This commit is contained in:
Vladimir Krivosheev
2014-04-24 18:07:13 +02:00
parent 13aec5ae6b
commit b275b4e996
2 changed files with 3 additions and 3 deletions
@@ -44,11 +44,11 @@ public class Launcher {
final URLClassLoader jpsLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]), Launcher.class.getClassLoader());
// IDEA-120811; speeding up DefaultChannelIDd calculation for netty
if (Boolean.parseBoolean(System.getProperty("io.netty.random.id"))) {
//if (Boolean.parseBoolean(System.getProperty("io.netty.random.id"))) {
final String id = UUID.randomUUID().toString();
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
}
//}
final Class<?> mainClass = jpsLoader.loadClass(mainClassName);
final Method mainMethod = mainClass.getMethod("main", String[].class);
@@ -45,7 +45,7 @@ public final class NettyUtil {
static {
// IDEA-120811
if (SystemProperties.getBooleanProperty("io.netty.random.id", false)) {
if (SystemProperties.getBooleanProperty("io.netty.random.id", true)) {
String id = UUID.randomUUID().toString();
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));