Github user wy96f commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2444#discussion_r236911890 --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java --- @@ -1018,6 +1018,7 @@ private void sendContinuations(final int packetSize, currentLargeMessage.addBytes(body); if (!continues) { + currentLargeMessage.sync(); currentLargeMessage.releaseResources(); --- End diff -- Some other code is calling releaseResources such as LargeServerMessageImpl::deleteFile, LargeMessageDeliverer::finish which would cost an extra system call. We'd better sync when the large message file is first created and finished. I just found ServerSessionImpl::messageToLargeMessage needs a sync as well. Could we add a sync parameter in releaseResources? If true, file will be synced before closing.
---