Murtadha Hubail has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2978

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
---
M 
hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/IPCConnectionManager.java
1 file changed, 1 insertion(+), 10 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/78/2978/1

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: newchange
Gerrit-Change-Id: I9f7ddc088868f8cf4d0a15ec5349021af8ccae36
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: stabilization-f69489
Gerrit-Owner: Murtadha Hubail <[email protected]>

Reply via email to