Skip to content

Commit 2e31064

Browse files
committed
Revert "Close urllib3 pool before swapping the server into the "inactive" list"
This reverts commit 21509d9. Apparently, this caused some downstream havoc, specifically observable on bad or flaky connection quality to the database.
1 parent b613f0d commit 2e31064

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/crate/client/http.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,6 @@ def _drop_server(self, server, message):
584584
"""
585585
Drop server from active list and adds it to the inactive ones.
586586
"""
587-
588-
# Try to close resource first.
589-
try:
590-
self.server_pool[server].close()
591-
except Exception as ex:
592-
logger.warning("When removing server from active pool, "
593-
"resource could not be closed: %s", ex)
594-
595-
# Apply bookkeeping.
596587
try:
597588
self._active_servers.remove(server)
598589
except ValueError:
@@ -601,7 +592,7 @@ def _drop_server(self, server, message):
601592
heapq.heappush(self._inactive_servers, (time(), server, message))
602593
logger.warning("Removed server %s from active pool", server)
603594

604-
# If this is the last server, raise an exception.
595+
# if this is the last server raise exception, otherwise try next
605596
if not self._active_servers:
606597
raise ConnectionError(
607598
("No more Servers available, "

0 commit comments

Comments
 (0)