You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/04/25 07:40:02 UTC

[GitHub] [shardingsphere] TeslaCN opened a new pull request #10189: Revise #10186

TeslaCN opened a new pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189


   Add submitted task count after execute `CommandExecutorTask`.


-- 
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.

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



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189#discussion_r619768636



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       How about change seq of line 42 and 43? 
   It seems better to increment count before task execute.




-- 
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.

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



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189#discussion_r619769827



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       Maybe we can add count before execute and catch `RejectedExecutinoException`.




-- 
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.

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



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189#discussion_r619768636



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       How about change seq of line 42 and 43? 
   It seems better to increment count before task execute.




-- 
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.

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



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189#discussion_r619769360



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       I think it is OK that add the submitted count after the task submitted.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       Maybe we can add count before execute and catch `RejectedExecutinoException`.




-- 
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.

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



[GitHub] [shardingsphere] strongduanmu merged pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
strongduanmu merged pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189


   


-- 
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.

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



[GitHub] [shardingsphere] strongduanmu merged pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
strongduanmu merged pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189


   


-- 
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.

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



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #10189: Revise #10186

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #10189:
URL: https://github.com/apache/shardingsphere/pull/10189#discussion_r619769360



##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/state/impl/OKProxyState.java
##########
@@ -40,5 +40,6 @@ public void execute(final ChannelHandlerContext context, final Object message, f
         ExecutorService executorService = CommandExecutorSelector.getExecutorService(
                 isOccupyThreadForPerConnection, supportHint, backendConnection.getTransactionStatus().getTransactionType(), context.channel().id());
         executorService.execute(new CommandExecutorTask(databaseProtocolFrontendEngine, backendConnection, context, message));
+        backendConnection.getSubmittedTaskCount().incrementAndGet();

Review comment:
       I think it is OK that add the submitted count after the task submitted.




-- 
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.

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