Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/main/java/com/arangodb/internal/net/HostSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class HostSet {
Expand Down Expand Up @@ -75,15 +76,17 @@ public void clearAllMarkedForDeletion() {

LOGGER.debug("Clear all Hosts in Set with markForDeletion");

for (Host host : hosts) {
Iterator<Host> iterable = hosts.iterator();
while (iterable.hasNext()){
Host host = iterable.next();
if (host.isMarkforDeletion()) {
try {

LOGGER.debug("Try to close Host " + host);
host.close();

} catch (IOException e) {
LOGGER.warn("Error during closing the Host " + host, e);
} finally {
iterable.remove();
}
}
}
Expand Down