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,20 +463,25 @@ public class Journal {
|
|||
return dataFile.getNext();
|
||||
}
|
||||
|
||||
public synchronized void close() throws IOException {
|
||||
if (!started) {
|
||||
return;
|
||||
public void close() throws IOException {
|
||||
synchronized (this) {
|
||||
if (!started) {
|
||||
return;
|
||||
}
|
||||
if (this.timer != null) {
|
||||
this.timer.cancel();
|
||||
}
|
||||
accessorPool.close();
|
||||
}
|
||||
if (this.timer != null) {
|
||||
this.timer.cancel();
|
||||
}
|
||||
accessorPool.close();
|
||||
// the appender can be calling back to to the journal blocking a close AMQ-5620
|
||||
appender.close();
|
||||
fileMap.clear();
|
||||
fileByFileMap.clear();
|
||||
dataFiles.clear();
|
||||
lastAppendLocation.set(null);
|
||||
started = false;
|
||||
synchronized (this) {
|
||||
fileMap.clear();
|
||||
fileByFileMap.clear();
|
||||
dataFiles.clear();
|
||||
lastAppendLocation.set(null);
|
||||
started = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected synchronized void cleanup() {
|
||||
|
|
Loading…
Reference in New Issue