Fix Windows named pipes with Java security manager (elastic/elasticsearch#410)

The problem is that the Java security manager can open the pipe and then
quickly close it, leading to a need to reconnect from the C++ side.

Original commit: elastic/x-pack-elasticsearch@772b57f443
This commit is contained in:
David Roberts 2016-11-29 12:38:06 +00:00 committed by GitHub
parent 576a591d3b
commit 62a0f64012
2 changed files with 7 additions and 2 deletions

View File

@ -153,7 +153,10 @@ public class CppLogMessageHandler implements Closeable {
// No more markers in this block
break;
}
parseMessage(xContent, bytesRef.slice(from, nextMarker - from));
// Ignore blank lines
if (nextMarker > from) {
parseMessage(xContent, bytesRef.slice(from, nextMarker - from));
}
from = nextMarker + 1;
}
return bytesRef.slice(from, bytesRef.length() - from);

View File

@ -112,8 +112,10 @@ public class AutodetectProcessManager extends AbstractComponent implements DataP
if (e.getCause() instanceof TimeoutException) {
logger.warn("Connection to process was dropped due to a timeout - if you are feeding this job from a connector it " +
"may be that your connector stalled for too long", e.getCause());
} else {
logger.error("Unexpected exception", e);
}
throw ExceptionsHelper.serverError(msg);
throw ExceptionsHelper.serverError(msg, e);
}
}