Skip to content
Merged
Changes from 4 commits
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
17 changes: 11 additions & 6 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,11 +2166,16 @@ def _send_cluster_commands(
# we dont' multiplex on the sockets as they come available,
# but that shouldn't make too much difference.
node_commands = nodes.values()
for n in node_commands:
n.write()
try:
node_commands = nodes.values()
for n in node_commands:
n.write()

for n in node_commands:
n.read()
for n in node_commands:
n.read()
finally:
for n in nodes.values():
n.connection_pool.release(n.connection)

# release all of the redis connections we allocated earlier
# back into the connection pool.
Expand All @@ -2190,8 +2195,8 @@ def _send_cluster_commands(
# buffered result back from a previous command and
# every single request after to that connection will always get
# a mismatched result.
for n in nodes.values():
n.connection_pool.release(n.connection)
# for n in nodes.values():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete this lines from the comment and move the explanations of this lines before them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already fixed this. could you review it again?

# n.connection_pool.release(n.connection)

# if the response isn't an exception it is a
# valid response from the node
Expand Down