Attempt at fixinf windows hanging issue again
Slightly altered timeout uitility seems to work much better.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user