ARTEMIS-831 avoid shutting down the server after interrupted threads on
divert (copy and rename) probably introduced at ARTEMIS-322
This commit is contained in:
parent
10187d0036
commit
b4924ce73b
|
@ -19,6 +19,7 @@ package org.apache.activemq.artemis.core.io;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.ClosedChannelException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
@ -117,6 +118,8 @@ public abstract class AbstractSequentialFile implements SequentialFile {
|
||||||
FileIOUtil.copyData(this, newFileName, buffer);
|
FileIOUtil.copyData(this, newFileName, buffer);
|
||||||
newFileName.close();
|
newFileName.close();
|
||||||
this.close();
|
this.close();
|
||||||
|
} catch (ClosedChannelException e) {
|
||||||
|
throw e;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
|
factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -140,6 +143,8 @@ public abstract class AbstractSequentialFile implements SequentialFile {
|
||||||
public final void renameTo(final String newFileName) throws IOException, InterruptedException, ActiveMQException {
|
public final void renameTo(final String newFileName) throws IOException, InterruptedException, ActiveMQException {
|
||||||
try {
|
try {
|
||||||
close();
|
close();
|
||||||
|
} catch (ClosedChannelException e) {
|
||||||
|
throw e;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
|
factory.onIOError(new ActiveMQIOErrorException(e.getMessage(), e), e.getMessage(), this);
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue