Revert "BUG6595: Adding a retry for getting a transactionsafely" 04/45104/1
authorAnil Vishnoi <vishnoianil@gmail.com>
Fri, 2 Sep 2016 17:30:02 +0000 (17:30 +0000)
committerAnil Vishnoi <vishnoianil@gmail.com>
Fri, 2 Sep 2016 17:30:02 +0000 (17:30 +0000)
This reverts commit b26b58ec652a1e7d8eb77f571b39604bf5e3cc86.

Change-Id: Ifcbbdbff26b3f1bbf7b9af336ea048403dcdde9a
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/TransactionChainManager.java

index 38b561314dddd773b4a557d07dc094e10c7f61c0..dcb7f70bbb8ca2237745298d22667f81cc0de3a2 100644 (file)
@@ -17,7 +17,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 
 import java.util.Objects;
 import java.util.concurrent.CancellationException;
-import java.util.concurrent.TimeUnit;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.annotation.concurrent.GuardedBy;
@@ -53,8 +52,6 @@ import org.slf4j.LoggerFactory;
 class TransactionChainManager implements TransactionChainListener, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(TransactionChainManager.class);
-    private static final Long RETRY_DELAY = 100L;
-    private static final int RETRY_COUNT = 3;
 
     private final Object txLock = new Object();
     private final KeyedInstanceIdentifier<Node, NodeKey> nodeII;
@@ -261,20 +258,9 @@ class TransactionChainManager implements TransactionChainListener, AutoCloseable
     @Nullable
     private WriteTransaction getTransactionSafely() {
             synchronized (txLock) {
-                int trial = 0;
-                while(trial <=RETRY_COUNT) {
-                    if (wTx == null && TransactionChainManagerStatus.WORKING.equals(transactionChainManagerStatus)) {
-                        if (wTx == null && txChainFactory != null) {
-                            wTx = txChainFactory.newWriteOnlyTransaction();
-                            break;
-                        }
-                    } else {
-                        try {
-                            TimeUnit.MILLISECONDS.sleep(RETRY_DELAY);
-                        } catch (InterruptedException e) {
-                            LOG.debug("Timer interrupted in getTransactionSafely : {}", e);
-                        }
-                        trial++;
+                if (wTx == null && TransactionChainManagerStatus.WORKING.equals(transactionChainManagerStatus)) {
+                    if (wTx == null && txChainFactory != null) {
+                        wTx = txChainFactory.newWriteOnlyTransaction();
                     }
                 }
             }
@@ -340,4 +326,4 @@ class TransactionChainManager implements TransactionChainListener, AutoCloseable
         /** txChainManager is trying to be closed - device disconnecting */
         SHUTTING_DOWN;
     }
-}
\ No newline at end of file
+}