Repository: activemq-artemis Updated Branches: refs/heads/1.x 9b2d5a0c7 -> 6018b2d74
NO-JIRA Fixing deadlock on JDBCJournal::stop / sync methods (cherry picked from commit ef8cb60df718049af827b61108316ddb306cfbdd) Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/53ef820e Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/53ef820e Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/53ef820e Branch: refs/heads/1.x Commit: 53ef820e89f5834c70dddb624de459455c9243fa Parents: 9b2d5a0 Author: Clebert Suconic <[email protected]> Authored: Thu Feb 2 21:07:06 2017 -0500 Committer: Clebert Suconic <[email protected]> Committed: Fri Feb 3 15:07:37 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/53ef820e/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); }
