Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2250#discussion_r220720824
--- Diff:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java
---
@@ -1796,15 +1826,15 @@ private synchronized JournalLoadInformation
load(final LoaderCallback loadManage
private void checkID(final long id) {
if (id > maxID.longValue()) {
- maxID.set(id);
+ maxID.lazySet(id);
--- End diff --
It's a fair concern, but If we are not single threaded here I'm quite sure
that both set/lazySet are wrong, given that none of them is addressing the
chance that others will do the same concurrently :)
But looking at the code maxID is being created and used with single
threaded semantic here, quoting the comments on the code:
`// AtomicLong is used only as a reference, not as an Atomic value
final AtomicLong maxID = new AtomicLong(-1); final AtomicLong
maxID = new AtomicLong(-1);`
---