You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/02/26 20:56:31 UTC

[GitHub] [geode] pivotal-eshu commented on a change in pull request #6054: GEODE-8907: CI Failure: ClientServerTransactionCCEDUnitTest.testTxRemoveAll

pivotal-eshu commented on a change in pull request #6054:
URL: https://github.com/apache/geode/pull/6054#discussion_r583911648



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionDUnitTest.java
##########
@@ -2108,6 +2110,8 @@ public Object call() throws Exception {
         TXManagerImpl mgr = getGemfireCache().getTxManager();
         Region<Integer, String> r = getGemfireCache().getRegion(D_REFERENCE);
         Region<CustId, Customer> pr = getGemfireCache().getRegion(CUSTOMER);
+        TXStateProxy tx = mgr.internalSuspend();

Review comment:
       This will not address the issue we saw in the pipeline.
   The issue is the thread can not internalSuspend a transaction, if it does not in a txState. Which we saw in the test failure on the second call.
   
   The correct fix is change the first callable return mgr.getTransactionId() to mgr.suspend().
       final TXId txid = (TXId) client.invoke(new SerializableCallable() {
         @Override
         public Object call() throws Exception {
           ClientCacheFactory ccf = new ClientCacheFactory();
           ccf.addPoolServer("localhost"/* getServerHostName(Host.getHost(0)) */, port1);
           ccf.addPoolServer("localhost", port2);
           ccf.setPoolLoadConditioningInterval(1);
           ccf.setPoolSubscriptionEnabled(false);
           ccf.set(LOG_LEVEL, getDUnitLogLevel());
           ClientCache cCache = getClientCache(ccf);
           ClientRegionFactory<CustId, Customer> custrf =
               cCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
           ClientRegionFactory<Integer, String> refrf =
               cCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
           Region<Integer, String> r = refrf.create(D_REFERENCE);
           Region<CustId, Customer> pr = custrf.create(CUSTOMER);
           // Region<Integer, String> order = refrf.create(ORDER);
   
           TXManagerImpl mgr = getGemfireCache().getTxManager();
           mgr.begin();
           int i = 0;
           for (int j = 0; j < 10; j++) {
             CustId custId = new CustId(i);
             Customer cust = new Customer("name" + i, "address" + i);
             getGemfireCache().getLogger().info("SWAP:putting:" + custId);
             pr.put(custId, cust);
             r.put(i, "value" + i);
           }
           return mgr.suspend();
         }
       });
   
   And here you can resume transaction by calling mgr.resume(txId);




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