Skip to content

Commit

Permalink
Async service timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Nov 20, 2020
1 parent a9f4e75 commit 5b1ff1d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
Proteus Changelog.

## Unreleased
### No issue

**Controllers are now compiled in parallel.**


[a9f4e75734b3515](https://github.com/noboomu/proteus/commit/a9f4e75734b3515) Joshua Bauer *2020-11-19 21:22:26*


## v0.4.6
### No issue

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<woodstox.version>6.0.3</woodstox.version>
<commons-lang3.version>3.9</commons-lang3.version>
<javapoet.version>1.11.1</javapoet.version>
<reflections.version>0.9.11</reflections.version>
<reflections.version>0.9.12</reflections.version>
<httpcore.version>4.4.12</httpcore.version>
<logback-classic.version>1.2.3</logback-classic.version>
<openapi.version>2.0.6</openapi.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
import io.undertow.util.Headers;
import io.undertow.util.Methods;
import org.apache.commons.lang3.time.DurationFormatUtils;
import org.checkerframework.checker.units.qual.C;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xnio.Options;

import javax.ws.rs.core.MediaType;
import java.io.ByteArrayOutputStream;
import java.io.File;
Expand All @@ -51,7 +48,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -171,13 +167,15 @@ public void start()
serviceManager.addListener(new Listener() {
public void stopped()
{

log.info("Services are stopped");
undertow.stop();
}

public void healthy()
{

log.info("Services are healthy");

startupDuration = Duration.ofMillis(System.currentTimeMillis() - startTime);

for (ListenerInfo info : undertow.getListenerInfo())
Expand Down Expand Up @@ -246,7 +244,15 @@ public void failure(Service service)

undertow.start();

serviceManager.startAsync();
try
{
serviceManager.startAsync().awaitHealthy(120L, TimeUnit.SECONDS);
} catch( Exception e )
{
log.error("Failed start to services within 2 minutes",e);
}

// serviceManager.startAsync();

}

Expand All @@ -265,7 +271,7 @@ public void shutdown() throws TimeoutException

this.running.set(false);

log.info("Shutdown complete.");
log.info("Shutdown complete");
}

public boolean isRunning()
Expand Down

0 comments on commit 5b1ff1d

Please sign in to comment.