avoid to keep the storage lock while waiting for the push thread to shutdown
@@ -505,7 +505,9 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O
status = STATUS.CLOSING;
super.close(true, false);
-
+ } finally {
+ stateLock.releaseWriteLock();
+ }
if (pushThread != null) {
pushThread.shutdown();
try {
@@ -514,7 +516,8 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O
Thread.currentThread().interrupt();
}
}
-
+ stateLock.acquireWriteLock();
+ try {
// CLOSE ALL THE SOCKET POOLS
for (String url : serverURLs) {
connectionManager.closePool(url);
