gemmellr commented on a change in pull request #3889:
URL: https://github.com/apache/activemq-artemis/pull/3889#discussion_r774957266



##########
File path: 
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java
##########
@@ -1051,12 +1052,18 @@ public void appendUpdateRecord(final long id,
                          ", userRecordType=" +
                          recordType);
       }
-
-      SimpleFuture<Boolean> future = new SimpleFutureImpl<>();
-
-      internalAppendUpdateRecord(id, recordType, persister, record, sync, 
false, (t, v) -> future.set(v), callback);
-
-      if (!future.get()) {
+      final SimpleFuture<Boolean> onFoundAddInfo;
+      if (!sync && (callback == null || callback == 
DummyCallback.getInstance())) {
+         onFoundAddInfo = null;
+      } else {
+         onFoundAddInfo = new SimpleFutureImpl<>();
+      }
+      if (onFoundAddInfo == null) {
+         internalAppendUpdateRecord(id, recordType, persister, record, false, 
false, null, callback);
+      } else {
+         internalAppendUpdateRecord(id, recordType, persister, record, sync, 
false, (t, v) -> onFoundAddInfo.set(v), callback);
+      }
+      if (onFoundAddInfo != null && !onFoundAddInfo.get()) {

Review comment:
       Newlines between these would aid readability. Collapsing the second _if_ 
with the internalAppendUpdateRecord calls into the first _if_ may also.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to