We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44cfdf0 commit e936efaCopy full SHA for e936efa
src/main/java/com/arangodb/internal/net/HostSet.java
@@ -6,6 +6,7 @@
6
import java.io.IOException;
7
import java.util.ArrayList;
8
import java.util.Collections;
9
+import java.util.Iterator;
10
import java.util.List;
11
12
public class HostSet {
@@ -75,15 +76,17 @@ public void clearAllMarkedForDeletion() {
75
76
77
LOGGER.debug("Clear all Hosts in Set with markForDeletion");
78
- for (Host host : hosts) {
79
+ Iterator<Host> iterable = hosts.iterator();
80
+ while (iterable.hasNext()){
81
+ Host host = iterable.next();
82
if (host.isMarkforDeletion()) {
83
try {
-
84
LOGGER.debug("Try to close Host " + host);
85
host.close();
86
} catch (IOException e) {
87
LOGGER.warn("Error during closing the Host " + host, e);
88
+ } finally {
89
+ iterable.remove();
90
}
91
92
0 commit comments