You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/09/29 12:10:53 UTC

[GitHub] [ignite-3] ptupitsyn opened a new pull request, #1135: IGNITE-17763 Use retry policy when connecting default channel

ptupitsyn opened a new pull request, #1135:
URL: https://github.com/apache/ignite-3/pull/1135

   Fixes testRetryReadPolicyRetriesReadOperations flakiness.


-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ptupitsyn commented on pull request #1135: IGNITE-17763 Use retry policy when connecting default channel

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on PR #1135:
URL: https://github.com/apache/ignite-3/pull/1135#issuecomment-1262373579

   @isapego I've added `ClientOperationType.CHANNEL_CONNECT` so that `RetryPolicy` implementation controls reconnect attempts (instead of hardcoded `DFLT_RETRY_LIMIT`). Please have another look.


-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] isapego commented on a diff in pull request #1135: IGNITE-17763 Use retry policy when connecting default channel

Posted by GitBox <gi...@apache.org>.
isapego commented on code in PR #1135:
URL: https://github.com/apache/ignite-3/pull/1135#discussion_r983913570


##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -583,8 +588,14 @@ private ClientChannel getDefaultChannel() {
     private boolean shouldRetry(int opCode, int iteration, IgniteClientConnectionException exception) {
         ClientOperationType opType = ClientUtils.opCodeToClientOperationType(opCode);
 
+        return shouldRetry(opType, iteration, exception);
+    }
+
+    /** Determines whether specified operation should be retried. */
+    private boolean shouldRetry(ClientOperationType opType, int iteration, IgniteClientConnectionException exception) {
         if (opType == null) {
-            return true; // System operation.
+            // System operation.
+            return iteration < RetryLimitPolicy.DFLT_RETRY_LIMIT;

Review Comment:
   So does `opType == null` is still used for some operations?



-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ptupitsyn merged pull request #1135: IGNITE-17763 Use retry policy when connecting default channel

Posted by GitBox <gi...@apache.org>.
ptupitsyn merged PR #1135:
URL: https://github.com/apache/ignite-3/pull/1135


-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] isapego commented on a diff in pull request #1135: IGNITE-17763 Use retry policy when connecting default channel

Posted by GitBox <gi...@apache.org>.
isapego commented on code in PR #1135:
URL: https://github.com/apache/ignite-3/pull/1135#discussion_r984271000


##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -583,8 +588,14 @@ private ClientChannel getDefaultChannel() {
     private boolean shouldRetry(int opCode, int iteration, IgniteClientConnectionException exception) {
         ClientOperationType opType = ClientUtils.opCodeToClientOperationType(opCode);
 
+        return shouldRetry(opType, iteration, exception);
+    }
+
+    /** Determines whether specified operation should be retried. */
+    private boolean shouldRetry(ClientOperationType opType, int iteration, IgniteClientConnectionException exception) {
         if (opType == null) {
-            return true; // System operation.
+            // System operation.
+            return iteration < RetryLimitPolicy.DFLT_RETRY_LIMIT;

Review Comment:
   Let's leave it this way for now, I'm not sure exposing too much internal implementation details to user will do any good here.



-- 
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: notifications-unsubscribe@ignite.apache.org

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


[GitHub] [ignite-3] ptupitsyn commented on a diff in pull request #1135: IGNITE-17763 Use retry policy when connecting default channel

Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on code in PR #1135:
URL: https://github.com/apache/ignite-3/pull/1135#discussion_r984206356


##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -583,8 +588,14 @@ private ClientChannel getDefaultChannel() {
     private boolean shouldRetry(int opCode, int iteration, IgniteClientConnectionException exception) {
         ClientOperationType opType = ClientUtils.opCodeToClientOperationType(opCode);
 
+        return shouldRetry(opType, iteration, exception);
+    }
+
+    /** Determines whether specified operation should be retried. */
+    private boolean shouldRetry(ClientOperationType opType, int iteration, IgniteClientConnectionException exception) {
         if (opType == null) {
-            return true; // System operation.
+            // System operation.
+            return iteration < RetryLimitPolicy.DFLT_RETRY_LIMIT;

Review Comment:
   Yes, for system operations, for example, `PARTITION_ASSIGNMENT_GET` and `SCHEMAS_GET`. On one hand, we don't want to expose those implementation details in the public API (`ClientOperationType`); on the other hand, retry for those things can not be tuned in config this way. Thoughts?



-- 
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: notifications-unsubscribe@ignite.apache.org

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