Attempt at fixinf windows hanging issue again

Slightly altered timeout uitility seems to work much better.
This commit is contained in:
Kris De Volder
2018-09-20 13:35:49 -07:00
parent 8eff17fc60
commit 0002646f2c
4 changed files with 11 additions and 3 deletions

View File

@@ -99,6 +99,9 @@ public abstract class AbstractSpringBootApp implements SpringBootApp {
String url = getJmxUrl();
logger.info("Creating JMX connector: "+url);
try {
if (url==null) {
throw new IOException("Couldn't obtain JMX url");
}
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(url), null);
logger.info("Created JMX connector: {}", connector);
return connector;

View File

@@ -136,7 +136,12 @@ public class LocalSpringBootApp extends AbstractSpringBootApp {
@Override
public Properties getSystemProperties() throws Exception {
return withTimeout(() -> vm.getSystemProperties());
try {
return withTimeout(() -> vm.getSystemProperties());
} catch (Exception e) {
logger.error("Fetching systemprops from local app failed: {}", ExceptionUtil.getMessage(e));
throw e;
}
}
public boolean containsSystemProperty(Object key) throws Exception {

View File

@@ -153,7 +153,7 @@ public abstract class LaunguageServerApp {
* https://github.com/itemis/xtext-languageserver-example/blob/master/org.xtext.example.mydsl.ide/src/org/xtext/example/mydsl/ide/RunServer.java
*/
public void startAsServer() throws IOException, InterruptedException {
Log.info("Starting LS as standlone server");
Log.info("Starting LS as standlone server port = "+SERVER_STANDALONE_PORT);
Function<MessageConsumer, MessageConsumer> wrapper = consumer -> {
MessageConsumer result = consumer;

View File

@@ -35,8 +35,8 @@ public class AsyncRunner {
public synchronized <T> CompletableFuture<T> invoke(Duration timeout, Callable<T> callable) {
CompletableFuture<T> x = Mono.fromCallable(callable)
.timeout(timeout)
.subscribeOn(executor)
.timeout(timeout)
.toFuture();
lastRequest = x;
return x;