You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "clebertsuconic (via GitHub)" <gi...@apache.org> on 2025/04/22 21:45:03 UTC

[PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

clebertsuconic opened a new pull request, #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646

   …n.start


-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2056282001


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,18 +120,20 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
+      // the module using the page operation should later call flowControl from this class.

Review Comment:
   The module using the page operation should later call `writeFlowControl`, right?



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic merged PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646


-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2055954835


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,15 +120,18 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
+      // the module using the page operation should later call flowControl from this class.
+      // the only exception to this would be from tests where we don't really care about flow control on the TimedExecutor
+      // also: the credits is based on the page size, and we use the encodeSize to flow it.
       int credits = Math.min(message.getEncodeSize() + PageReadWriter.SIZE_RECORD, maxCredits);
-      writeCredits.acquireUninterruptibly(credits);
+

Review Comment:
   Oh yeah.. good point!
   
   thanks a lot



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2055153468


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,15 +120,15 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
       int credits = Math.min(message.getEncodeSize() + PageReadWriter.SIZE_RECORD, maxCredits);
-      writeCredits.acquireUninterruptibly(credits);
+      //writeCredits.acquireUninterruptibly(credits);

Review Comment:
   oops.. thanks... I forgot to remove it...
   
   I kept adding it back and forth during my testing (to reproduce the issue) and I forgot to remove it.. thanks



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "gemmellr (via GitHub)" <gi...@apache.org>.
gemmellr commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2055855161


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,15 +120,18 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
+      // the module using the page operation should later call flowControl from this class.
+      // the only exception to this would be from tests where we don't really care about flow control on the TimedExecutor
+      // also: the credits is based on the page size, and we use the encodeSize to flow it.
       int credits = Math.min(message.getEncodeSize() + PageReadWriter.SIZE_RECORD, maxCredits);
-      writeCredits.acquireUninterruptibly(credits);
+

Review Comment:
   This line removed acquisition of credit, but the lines immediately below still have what looks like a compensating-release of credit if not started. Should that go now?



##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,15 +120,18 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
+      // the module using the page operation should later call flowControl from this class.
+      // the only exception to this would be from tests where we don't really care about flow control on the TimedExecutor
+      // also: the credits is based on the page size, and we use the encodeSize to flow it.
       int credits = Math.min(message.getEncodeSize() + PageReadWriter.SIZE_RECORD, maxCredits);
-      writeCredits.acquireUninterruptibly(credits);
+

Review Comment:
   This line change removed acquisition of credit, but the lines immediately below still have what looks like a compensating-release of credit if not started. Should that go now?



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2054950611


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,15 +120,15 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
       int credits = Math.min(message.getEncodeSize() + PageReadWriter.SIZE_RECORD, maxCredits);
-      writeCredits.acquireUninterruptibly(credits);
+      //writeCredits.acquireUninterruptibly(credits);

Review Comment:
   Commented out code is usually confusing for future maintenance, recommend removing this line 



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2054951827


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java:
##########
@@ -1327,23 +1328,27 @@ public boolean page(Message message,
 
          // we are in page mode, if we got to this point, we are dropping the message while still paging
          // this needs to return true as it is paging

Review Comment:
   The comment is now out of date and should be updated



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact



Re: [PR] ARTEMIS-5441 Flow control on PageTimedWriter deadlocks with Repliatio… [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #5646:
URL: https://github.com/apache/activemq-artemis/pull/5646#discussion_r2056282001


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java:
##########
@@ -118,18 +120,20 @@ public void incrementTask() {
       pendingTasksUpdater.incrementAndGet(this);
    }
 
-   public void addTask(OperationContext context,
+   public int addTask(OperationContext context,
                                     PagedMessage message,
                                     Transaction tx,
-                                    RouteContextList listCtx) {
+                                    RouteContextList listCtx, boolean useFlowControl) {
 
       logger.trace("Adding paged message {} to paged writer", message);
 
+      // the module using the page operation should later call flowControl from this class.

Review Comment:
   The module using the page operation should later call `writeFlowControl`, right?



-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For additional commands, e-mail: gitbox-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact