[Transactions] Prevent NPE in case of closeAsync() without a successful execution of startAsync()
Fixes
### Motivation
If the initialisation of TransactionCoordinatorClientImpl is not completed calling closeAsync will result in a NPE.
@@ -134,6 +134,7 @@ public class TransactionCoordinatorClientImpl implements TransactionCoordinatorC
LOG.warn("The transaction meta store is closing or closed, doing nothing.");
result.complete(null);
} else {
+ if (handlers != null) {
for (TransactionMetaStoreHandler handler : handlers) {
try {
handler.close();
@@ -141,6 +142,7 @@ public class TransactionCoordinatorClientImpl implements TransactionCoordinatorC
LOG.warn("Close transaction meta store handler error", e);
}
}
+ }
this.handlers = null;
result.complete(null);
}
