eolivelli commented on a change in pull request #12700:
URL: https://github.com/apache/pulsar/pull/12700#discussion_r753671072
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MLPendingAckStore.java
##########
@@ -361,15 +360,17 @@ public void run() {
class FillEntryQueueCallback implements AsyncCallbacks.ReadEntriesCallback
{
+ private boolean isReadable = true;
Review comment:
volatile ? or AtomicBoolean
in fact outstandingReadsRequests is a AtomicLong
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MLPendingAckStore.java
##########
@@ -303,13 +303,12 @@ public void addFailed(ManagedLedgerException exception,
Object ctx) {
@Override
public void run() {
try {
- while (lastConfirmedEntry.compareTo(currentLoadPosition) > 0) {
- if (((ManagedCursorImpl) cursor).isClosed()) {
- log.warn("[{}] MLPendingAckStore cursor have been
closed, close replay thread.",
- cursor.getManagedLedger().getName());
- return;
- }
- fillEntryQueueCallback.fillQueue();
+ if (((ManagedCursorImpl) cursor).isClosed()) {
Review comment:
this kind of casts are always a code smell and add tech debt.
can we add "isClosed" to the ManagedCursor interface ?
otherwise if this class is meant to work only with ManagedCursorImpl then we
must change the type of "cursor" to ManagedCursorImpl and to not perform this
casts
--
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]