You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ma...@apache.org on 2017/02/03 14:30:10 UTC
[4/6] activemq-artemis git commit: NO-JIRA Fixing deadlock on
JDBCJournal::stop / sync methods
NO-JIRA Fixing deadlock on JDBCJournal::stop / sync methods
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ef8cb60d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ef8cb60d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ef8cb60d
Branch: refs/heads/master
Commit: ef8cb60df718049af827b61108316ddb306cfbdd
Parents: ce035a8
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Feb 2 21:07:06 2017 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Feb 3 09:04:57 2017 -0500
----------------------------------------------------------------------
.../artemis/jdbc/store/journal/JDBCJournalImpl.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ef8cb60d/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
index f718785..dbab0e6 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
@@ -74,8 +74,6 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
private final Executor completeExecutor;
- private final Object journalLock = new Object();
-
private final ScheduledExecutorService scheduledExecutorService;
// Track Tx Records
@@ -135,11 +133,9 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
@Override
public synchronized void stop() throws SQLException {
if (started) {
- synchronized (journalLock) {
- sync();
- started = false;
- super.stop();
- }
+ sync();
+ started = false;
+ super.stop();
}
}
@@ -305,7 +301,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
record.setIoCompletion(callback);
}
- synchronized (journalLock) {
+ synchronized (this) {
if (record.isTransactional() || record.getRecordType() == JDBCJournalRecord.PREPARE_RECORD) {
addTxRecord(record);
}