You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "netudima (via GitHub)" <gi...@apache.org> on 2026/06/06 17:57:10 UTC

[PR] [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity [cassandra]

netudima opened a new pull request, #4869:
URL: https://github.com/apache/cassandra/pull/4869

   patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-21429
   


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima closed pull request #4869: [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity
URL: https://github.com/apache/cassandra/pull/4869


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on PR #4869:
URL: https://github.com/apache/cassandra/pull/4869#issuecomment-4654053735

   Merged as https://github.com/apache/cassandra/commit/88aa5b6807dbd97446d34864e87a34493880358b


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity [cassandra]

Posted by "belliottsmith (via GitHub)" <gi...@apache.org>.
belliottsmith commented on code in PR #4869:
URL: https://github.com/apache/cassandra/pull/4869#discussion_r3373075999


##########
src/java/org/apache/cassandra/concurrent/SEPExecutor.java:
##########
@@ -123,18 +123,9 @@ protected <T extends Runnable> T addTask(T task)
         // we add to the queue first, so that when a worker takes a task permit it can be certain there is a task available
         // this permits us to schedule threads non-spuriously; it also means work is serviced fairly
         tasks.add(task);
-        int taskPermits;
-        while (true)
-        {
-            long current = permits.get();
-            taskPermits = taskPermits(current);
-            // because there is no difference in practical terms between the work permit being added or not (the work is already in existence)
-            // we always add our permit, but block after the fact if we breached the queue limit
-            if (permits.compareAndSet(current, updateTaskPermits(current, taskPermits + 1)))
-                break;
-        }
 
-        if (taskPermits == 0)
+        long current = permits.getAndAdd(updateTaskPermits(0, 1));

Review Comment:
   maybe prev now, since we've already updated it this way?



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] [CASSANDRA-21429][trunk] SEPExecutor#maybeExecuteImmediately not always run tasks immediate even if there is worker capacity [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #4869:
URL: https://github.com/apache/cassandra/pull/4869#discussion_r3373110573


##########
src/java/org/apache/cassandra/concurrent/SEPExecutor.java:
##########
@@ -123,18 +123,9 @@ protected <T extends Runnable> T addTask(T task)
         // we add to the queue first, so that when a worker takes a task permit it can be certain there is a task available
         // this permits us to schedule threads non-spuriously; it also means work is serviced fairly
         tasks.add(task);
-        int taskPermits;
-        while (true)
-        {
-            long current = permits.get();
-            taskPermits = taskPermits(current);
-            // because there is no difference in practical terms between the work permit being added or not (the work is already in existence)
-            // we always add our permit, but block after the fact if we breached the queue limit
-            if (permits.compareAndSet(current, updateTaskPermits(current, taskPermits + 1)))
-                break;
-        }
 
-        if (taskPermits == 0)
+        long current = permits.getAndAdd(updateTaskPermits(0, 1));

Review Comment:
   yes, it is more correct



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org