mirror of
https://github.com/happyfish100/fastdfs-client-java.git
synced 2026-09-17 17:29:00 +00:00
prevent re-entrancy for closeConnection
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
|
||||
Version 1.39 2025-12-18
|
||||
Version 1.39 2025-12-19
|
||||
* ConnectionPool.getKey() use '-' instead of ':'
|
||||
* ConnectionManager.java: remove private AtomicInteger freeCount
|
||||
* ConnectionManager.java: prevent re-entrancy for closeConnection
|
||||
|
||||
Version 1.38 2025-11-28
|
||||
* bugfixed: loadStorageServersFromTracker correctly with rw option
|
||||
|
||||
@@ -120,6 +120,10 @@ public class Connection {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isClosed() {
|
||||
return this.sock == null;
|
||||
}
|
||||
|
||||
public boolean isNeedActiveTest() {
|
||||
return needActiveTest;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ public class ConnectionManager {
|
||||
if (connection == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
lock.lock();
|
||||
try {
|
||||
connection.setLastAccessTime(System.currentTimeMillis());
|
||||
@@ -115,8 +116,12 @@ public class ConnectionManager {
|
||||
}
|
||||
|
||||
public void closeConnection(Connection connection) {
|
||||
if (connection == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (connection != null) {
|
||||
if (!connection.isClosed()) {
|
||||
totalCount.decrementAndGet();
|
||||
connection.closeDirectly();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user