mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5620 - avoid potential deadlock on shutdown - waiting on connections to stop before stopping the pa would be an alternative but may block for ever, auto rollback ensures there is no need
This commit is contained in:
parent
4f57744934
commit
260e28ecad
|
@ -463,7 +463,8 @@ public class Journal {
|
||||||
return dataFile.getNext();
|
return dataFile.getNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void close() throws IOException {
|
public void close() throws IOException {
|
||||||
|
synchronized (this) {
|
||||||
if (!started) {
|
if (!started) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -471,13 +472,17 @@ public class Journal {
|
||||||
this.timer.cancel();
|
this.timer.cancel();
|
||||||
}
|
}
|
||||||
accessorPool.close();
|
accessorPool.close();
|
||||||
|
}
|
||||||
|
// the appender can be calling back to to the journal blocking a close AMQ-5620
|
||||||
appender.close();
|
appender.close();
|
||||||
|
synchronized (this) {
|
||||||
fileMap.clear();
|
fileMap.clear();
|
||||||
fileByFileMap.clear();
|
fileByFileMap.clear();
|
||||||
dataFiles.clear();
|
dataFiles.clear();
|
||||||
lastAppendLocation.set(null);
|
lastAppendLocation.set(null);
|
||||||
started = false;
|
started = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected synchronized void cleanup() {
|
protected synchronized void cleanup() {
|
||||||
if (accessorPool != null) {
|
if (accessorPool != null) {
|
||||||
|
|
Loading…
Reference in New Issue