diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java index 5665e571c4..0c6dcdfc36 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java @@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.io; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; @@ -117,6 +118,8 @@ public abstract class AbstractSequentialFile implements SequentialFile { FileIOUtil.copyData(this, newFileName, buffer); newFileName.close(); this.close(); + } catch (ClosedChannelException e) { + throw e; } catch (IOException e) { factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this); throw e; @@ -140,6 +143,8 @@ public abstract class AbstractSequentialFile implements SequentialFile { public final void renameTo(final String newFileName) throws IOException, InterruptedException, ActiveMQException { try { close(); + } catch (ClosedChannelException e) { + throw e; } catch (IOException e) { factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this); throw e;