Murtadha Hubail has submitted this change and it was merged.

Change subject: [NO ISSUE][NET] Avoid Sleeping The Network Thread on Failures
......................................................................


[NO ISSUE][NET] Avoid Sleeping The Network Thread on Failures

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- We currently sleep the networking thread incrementally with
  every failure. This sleep was added to avoid CPU spinning
  back when failures on pending networking operations were not
  handled properly which led to processing the same networking
  message that caused the failure over and over. This sleep is
  not needed anymore since every failed read/write/send/connect
  network operations will not be attempted again.

Change-Id: I9f7ddc088868f8cf4d0a15ec5349021af8ccae36
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2978
Integration-Tests: Jenkins <[email protected]>
Sonar-Qube: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Reviewed-by: Michael Blow <[email protected]>
---
M 
hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
1 file changed, 1 insertion(+), 10 deletions(-)

Approvals:
  Anon. E. Moose #1000171: 
  Jenkins: Verified; No violations found; Verified
  Michael Blow: Looks good to me, approved



diff --git 
a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
 
b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
index 53ada46..9ef506e 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
@@ -185,7 +185,6 @@
         }
 
         private void doRun() {
-            int failingLoops = 0;
             while (!stopped) {
                 try {
                     int n = selector.select();
@@ -199,16 +198,8 @@
                     if (n > 0) {
                         processSelectedKeys();
                     }
-                    // reset failingLoops on a good loop
-                    failingLoops = 0;
                 } catch (Exception e) {
-                    int sleepSecs = (int) Math.pow(2, Math.min(11, 
failingLoops++));
-                    LOGGER.log(Level.ERROR, "Exception processing message; 
sleeping " + sleepSecs + " seconds", e);
-                    try {
-                        Thread.sleep(TimeUnit.SECONDS.toMillis(sleepSecs));
-                    } catch (InterruptedException e1) {
-                        Thread.currentThread().interrupt();
-                    }
+                    LOGGER.log(Level.ERROR, "Exception processing message", e);
                 }
             }
         }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2978
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9f7ddc088868f8cf4d0a15ec5349021af8ccae36
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: stabilization-f69489
Gerrit-Owner: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Till Westmann <[email protected]>

Reply via email to