Github user jbertram commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/872#discussion_r85810848
--- Diff:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java
---
@@ -688,32 +690,37 @@ public void appendAddRecord(final long id,
final boolean sync,
final IOCompletion callback) throws
Exception {
checkJournalIsLoaded();
+ lineUpContext(callback);
+ pendingRecords.add(id);
- journalLock.readLock().lock();
-
- try {
- JournalInternalRecord addRecord = new JournalAddRecord(true, id,
recordType, record);
-
- if (callback != null) {
- callback.storeLineUp();
- }
-
- synchronized (lockAppend) {
- JournalFile usedFile = appendRecord(addRecord, false, sync,
null, callback);
+ Future<?> result = appendExecutor.submit(new Runnable() {
+ @Override
+ public void run() {
+ journalLock.readLock().lock();
+ try {
+ JournalInternalRecord addRecord = new
JournalAddRecord(true, id, recordType, record);
+ JournalFile usedFile = appendRecord(addRecord, false, sync,
null, callback);
+ records.put(id, new JournalRecord(usedFile,
addRecord.getEncodeSize()));
- if (logger.isTraceEnabled()) {
- logger.trace("appendAddRecord::id=" + id +
- ", userRecordType=" +
- recordType +
- ", record = " + record +
- ", usedFile = " +
- usedFile);
+ if (logger.isTraceEnabled()) {
+ logger.trace("appendAddRecord::id=" + id +
+ ", userRecordType=" +
+ recordType +
+ ", record = " + record +
+ ", usedFile = " +
+ usedFile);
+ }
+ } catch (Exception e) {
+ ActiveMQJournalLogger.LOGGER.error(e.getMessage(), e);
--- End diff --
Shouldn't this have a concrete method rather than just using error()?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---