Skip to content

Commit

Permalink
issue base BASE-1276 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kurilov committed Oct 7, 2018
1 parent 5c8b155 commit 42d6c08
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
import com.emc.mongoose.logging.Loggers;
import com.emc.mongoose.metrics.DistributedMetricsContext;
import com.emc.mongoose.metrics.DistributedMetricsContextImpl;
import com.emc.mongoose.metrics.DistributedMetricsSnapshot;
import com.emc.mongoose.metrics.MetricsContext;
import com.emc.mongoose.metrics.MetricsManager;
import com.emc.mongoose.metrics.MetricsSnapshot;
import com.emc.mongoose.storage.driver.StorageDriver;
import static com.emc.mongoose.Constants.KEY_CLASS_NAME;
import static com.emc.mongoose.Constants.KEY_STEP_ID;
import static com.emc.mongoose.config.ConfigUtil.flatten;

import com.github.akurilov.commons.concurrent.AsyncRunnableBase;
import com.github.akurilov.commons.io.Input;
import com.github.akurilov.commons.net.NetUtil;
Expand All @@ -34,8 +36,10 @@
import com.github.akurilov.confuse.Config;
import com.github.akurilov.confuse.impl.BasicConfig;
import com.github.akurilov.fiber4j.ExclusiveFiberBase;
import static org.apache.logging.log4j.CloseableThreadContext.Instance;
import static org.apache.logging.log4j.CloseableThreadContext.put;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.message.ThreadDumpMessage;

import java.io.IOException;
import java.rmi.RemoteException;
Expand All @@ -50,12 +54,6 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static com.emc.mongoose.Constants.KEY_CLASS_NAME;
import static com.emc.mongoose.Constants.KEY_STEP_ID;
import static com.emc.mongoose.config.ConfigUtil.flatten;
import static org.apache.logging.log4j.CloseableThreadContext.Instance;
import static org.apache.logging.log4j.CloseableThreadContext.put;

public abstract class LoadStepClientBase
extends LoadStepBase
implements LoadStepClient {
Expand Down Expand Up @@ -399,7 +397,7 @@ public final boolean await(final long timeout, final TimeUnit timeUnit)
protected final void invokeTimedExclusively(final long startTimeNanos) {
Loggers.MSG.trace("{}: await for the step slice \"{}\" started", id(), stepSlice);
try {
if(stepSlice.await(1, TimeUnit.NANOSECONDS)) {
if(stepSlice.await(SOFT_DURATION_LIMIT_NANOS, TimeUnit.NANOSECONDS)) {
awaitCountDown.countDown();
stop();
}
Expand All @@ -411,7 +409,7 @@ protected final void invokeTimedExclusively(final long startTimeNanos) {
} catch(final InterruptedException e) {
throw new InterruptRunException(e);
} catch(final IllegalStateException e) {
LogUtil.exception(Level.DEBUG, e, "{}: failure in the await method", id());
LogUtil.exception(Level.WARN, e, "{}: failure in the await method", id());
}
}
}
Expand All @@ -428,13 +426,13 @@ protected final void invokeTimedExclusively(final long startTimeNanos) {
} catch(final InterruptRunException e) {
throw e;
} catch(final Exception e) {
LogUtil.exception(Level.DEBUG, e, "{}: await task closing failure", id());
LogUtil.exception(Level.WARN, e, "{}: await task closing failure", id());
}
}
);
}
} finally {
Loggers.MSG.debug("{}: await for {} step slices done", id(), stepSliceCount);
Loggers.MSG.info("{}: await for {} step slices done", id(), stepSliceCount);
}
}

Expand Down

0 comments on commit 42d6c08

Please sign in to comment.