>From Michael Blow <[email protected]>:
Michael Blow has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18772 )
Change subject: [NO ISSUE][HYR][HTTP] Allow subclasses to override delay before
interrupt
......................................................................
[NO ISSUE][HYR][HTTP] Allow subclasses to override delay before interrupt
Ext-ref: MB-62997
Change-Id: I2c173fbdc985ea590da5315c1ce18e7610fb6bf0
---
M
hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
1 file changed, 17 insertions(+), 1 deletion(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/72/18772/1
diff --git
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
index 271de53..5b5222a 100644
---
a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
+++
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServer.java
@@ -358,6 +358,10 @@
}
protected void doStop() throws InterruptedException {
+ doStop(5, TimeUnit.SECONDS);
+ }
+
+ protected void doStop(long delayBeforeInterrupt, TimeUnit
delayBeforeInterruptUnit) throws InterruptedException {
// stop recovery if it was ongoing
Thread rt = recoveryThread;
if (rt != null) {
@@ -367,7 +371,9 @@
executor.shutdown();
try {
// wait 5s before interrupting existing requests
- executor.awaitTermination(5, TimeUnit.SECONDS);
+ if (delayBeforeInterrupt > 0) {
+ executor.awaitTermination(delayBeforeInterrupt,
delayBeforeInterruptUnit);
+ }
// interrupt
executor.shutdownNow();
// wait 30s for interrupted requests to unwind
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18772
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: goldfish
Gerrit-Change-Id: I2c173fbdc985ea590da5315c1ce18e7610fb6bf0
Gerrit-Change-Number: 18772
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <[email protected]>
Gerrit-MessageType: newchange