File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2006,6 +2006,7 @@ def _send_cluster_commands(
2006
2006
except (ConnectionError , TimeoutError ) as e :
2007
2007
for n in nodes .values ():
2008
2008
n .connection_pool .release (n .connection )
2009
+ n .connection = None
2009
2010
nodes = {}
2010
2011
if self .retry and isinstance (
2011
2012
e , self .retry ._supported_errors
@@ -2060,6 +2061,7 @@ def _send_cluster_commands(
2060
2061
# a mismatched result.
2061
2062
for n in nodes .values ():
2062
2063
n .connection_pool .release (n .connection )
2064
+ n .connection = None
2063
2065
nodes = {}
2064
2066
2065
2067
# if the response isn't an exception it is a
@@ -2127,8 +2129,9 @@ def _send_cluster_commands(
2127
2129
# since we cant guarantee the state of the connections,
2128
2130
# disconnect before returning it to the connection pool
2129
2131
for n in nodes .values ():
2130
- n .connection .disconnect ()
2131
- n .connection_pool .release (n .connection )
2132
+ if n .connection :
2133
+ n .connection .disconnect ()
2134
+ n .connection_pool .release (n .connection )
2132
2135
raise
2133
2136
2134
2137
def _fail_on_redirect (self , allow_redirections ):
You can’t perform that action at this time.
0 commit comments