Repository navigation
[pulsar-broker] schedule one add/read timeout task per ml/topic - #4111
Conversation
|
rerun java8 tests |
| // last read-operation's callback to check read-timeout on it. | ||
| private static final AtomicReferenceFieldUpdater<ManagedLedgerImpl, ReadEntryCallbackWrapper> LAST_READ_CALLBACK = AtomicReferenceFieldUpdater | ||
| .newUpdater(ManagedLedgerImpl.class, ReadEntryCallbackWrapper.class, "lastReadCallback"); | ||
| private volatile ReadEntryCallbackWrapper lastReadCallback = null; |
There was a problem hiding this comment.
@rdhabalia Just one comment here. If we're just doing get/set operations on the variable, then we don't need the updater object since LAST_READ_CALLBACK.set(this, someOtherVar) would be equivalent to doing lastReadCallback = someOtherVar (provided that lastReadCallback is already volatile).
We really need the updater if using compareAndSet() and similar ops.
There was a problem hiding this comment.
that's true..there is no use of AtomicReferenceFieldUpdater.. will fix it.
|
@rdhabalia Hi, I noticed we only introduced a single For instance, there is a read operation A, we will set Is there something else I don't understand or a bug? |
Motivation
It will schedule only one timeout task per ml/topic which times out stuck add/read request and fails the callback.