Skip to content

Commit

Permalink
Merge pull request #64 from emc-mongoose/release-v3.5.1
Browse files Browse the repository at this point in the history
Release v3.5.1
  • Loading branch information
akurilov authored Nov 3, 2017
2 parents de7fc0d + eade8c0 commit 930dfdc
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@ boolean isIdle()

void adjustIoBuffers(final long avgDataItemSize, final IoType ioType)
throws RemoteException;

@Override
void close()
throws IOException;
}
4 changes: 2 additions & 2 deletions config/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
// An user may place here a key-value pair which will be used as HTTP header.
"headers" : {
"Connection" : "Keep-Alive",
"User-Agent" : "mongoose/3.5.0"
"User-Agent" : "mongoose/3.5.1"
},
// The HTTP storage namespace.
// WARNING: the default value (null) will not work in the case of Swift API
Expand Down Expand Up @@ -313,7 +313,7 @@
}
},
// The Mongoose version
"version" : "3.5.0",
"version" : "3.5.1",
// The aliasing section mapping the old configuration parameters/values to the current ones
"aliasing" : [

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN ln -s /opt/mongoose-* /opt/mongoose

EXPOSE 9010

ENTRYPOINT ["java", "-Dcom.sun.management.jmxremote", "-Dcom.sun.management.jmxremote.port=9010", "-Dcom.sun.management.jmxremote.rmi.port=9010", "-Dcom.sun.management.jmxremote.local.only=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.ssl=false", "-jar", "/opt/mongoose/mongoose.jar"]
ENTRYPOINT ["java", "-jar", "/opt/mongoose/mongoose.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,7 @@ protected void doShutdown()
Loggers.ERR.warn("{}: load controller shutdown timeout", getName());
}
} catch(final InterruptedException e) {
LogUtil.exception(Level.WARN, e, "{}: load controller shutdown interrupted", getName());
throw new CancellationException();
throw new CancellationException(e.getMessage());
}
}

Expand Down Expand Up @@ -779,9 +778,7 @@ protected final void doInterrupt()
Loggers.ERR.warn("{}: storage drivers interrupting timeout", getName());
}
} catch(final InterruptedException e) {
LogUtil.exception(
Level.WARN, e, "{}: storage drivers interrupting interrupted", getName()
);
throw new CancellationException(e.getMessage());
}

for(final Coroutine transferCoroutine : transferCoroutines) {
Expand All @@ -792,7 +789,8 @@ protected final void doInterrupt()
}

final ExecutorService ioResultsExecutor = Executors.newFixedThreadPool(
ThreadUtil.getHardwareThreadCount(), new LogContextThreadFactory("ioResultsWorker", true)
ThreadUtil.getHardwareThreadCount(),
new LogContextThreadFactory("ioResultsWorker", true)
);
synchronized(driversMap) {
for(final LoadGenerator<I, O> generator : generatorsMap.values()) {
Expand Down Expand Up @@ -843,10 +841,7 @@ protected final void doInterrupt()
);
}
} catch(final InterruptedException e) {
LogUtil.exception(
Level.WARN, e,
"{}: interrupted while getting and processing the final I/O results", getName()
);
throw new CancellationException(e.getMessage());
}
}

Expand Down Expand Up @@ -874,7 +869,8 @@ protected final void doInterrupt()
);
}
}
} catch(final InterruptedException ignored) {
} catch(final InterruptedException e) {
throw new CancellationException(e.getMessage());
} finally {
Loggers.MSG.info("{}: I/O results output done", name);
}
Expand All @@ -900,7 +896,7 @@ protected final void doInterrupt()
try {
MetricsManager.unregister(this, nextStats);
} catch(final InterruptedException e) {
LogUtil.exception(Level.WARN, e, "{}: metrics context unregister failure", name);
throw new CancellationException(e.getMessage());
}
}

Expand All @@ -911,39 +907,68 @@ protected final void doInterrupt()
protected final void doClose()
throws IOException {

final ExecutorService closeExecutor = Executors.newFixedThreadPool(
ThreadUtil.getHardwareThreadCount(),
new LogContextThreadFactory("interruptWorker", true)
);

synchronized (driversMap) {

for(final LoadGenerator<I, O> generator : driversMap.keySet()) {

try {
generator.close();
Loggers.MSG.debug(
"{}: the load generator \"{}\" has been closed", getName(), generator
);
} catch(final IOException e) {
LogUtil.exception(
Level.WARN, e, "{}: failed to close the generator {}", getName(), generator
closeExecutor.submit(
() -> {
try {
generator.close();
Loggers.MSG.debug(
"{}: the load generator \"{}\" has been closed", getName(),
generator
);
} catch(final IOException e) {
LogUtil.exception(
Level.WARN, e, "{}: failed to close the generator {}", getName(),
generator
);
}
}
);

for(final StorageDriver<I, O> driver : driversMap.get(generator)) {
closeExecutor.submit(
() -> {
try {
driver.close();
Loggers.MSG.debug("{}: next storage driver {} closed", getName(),
((driver instanceof Service) ?
((Service) driver).getName() + " @ " +
ServiceUtil.getAddress((Service) driver) :
driver.toString())
);
} catch(final NoSuchObjectException ignored) {
// closing causes this normally
} catch(final IOException e) {
LogUtil.exception(
Level.WARN, e, "{}: failed to close the driver {}",
getName(), driver.toString()
);
}
}
);
}
}

for(final StorageDriver<I, O> driver : driversMap.get(generator)) {
try {
driver.close();
Loggers.MSG.debug("{}: next storage driver {} closed", getName(),
((driver instanceof Service) ?
((Service) driver).getName() + " @ " +
ServiceUtil.getAddress((Service) driver) :
driver.toString())
);
} catch(final NoSuchObjectException ignored) {
// closing causes this normally
} catch(final IOException e) {
LogUtil.exception(
Level.WARN, e, "{}: failed to close the driver {}",
getName(), driver.toString()
);
}
closeExecutor.shutdown();
try {
if(closeExecutor.awaitTermination(10, TimeUnit.SECONDS)) {
Loggers.MSG.debug(
"{}: all generators and storage drivers have been closed in time", getName()
);
} else {
closeExecutor.shutdownNow();
Loggers.ERR.warn("{}: timeout while closing storage driver(s)", getName());
}
} catch(final InterruptedException e) {
throw new CancellationException(e.getMessage());
}

generatorsMap.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void shouldParseWithoutFireballsThrowing()
throws IOException {
final Config config = Config.loadDefaults();
assertThat(config, notNullValue());
assertThat(config.getVersion(), equalTo("3.5.0", "version"));
assertThat(config.getVersion(), equalTo("3.5.1", "version"));
final NetConfig netConfig = config.getStorageConfig().getNetConfig();
assertThat(netConfig, notNullValue());
assertThat(netConfig.getTimeoutMilliSec(), equalTo(0, "storage.net.timeoutMilliSec"));
Expand Down Expand Up @@ -149,7 +149,7 @@ public void shouldParseWithoutFireballsThrowing()
assertThat(headers.containsKey(HttpConfig.KEY_HEADER_USER_AGENT),
equalTo(true, "storage.net.http.headers[User-Agent]"));
assertThat(headers.get(HttpConfig.KEY_HEADER_USER_AGENT),
equalTo("mongoose/3.5.0", "storage.net.http.headers[User-Agent]"));
equalTo("mongoose/3.5.1", "storage.net.http.headers[User-Agent]"));
assertThat(httpConfig.getNamespace(), nullValue("storage.net.http.namespace"));
assertThat(httpConfig.getVersioning(), equalTo(false, "storage.net.http.versioning"));
assertThat(
Expand Down

0 comments on commit 930dfdc

Please sign in to comment.