Skip to content

Commit eff9108

Browse files
committed
Fix deque mutated while iterating error
1 parent 7b6fff4 commit eff9108

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neo4j/v1/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def recycle(self, session):
140140
:return:
141141
"""
142142
pool = self.session_pool
143-
for s in pool:
143+
for s in list(pool): # freezing the pool into a list for iteration allows pool mutation inside the loop
144144
if not s.healthy:
145145
pool.remove(s)
146146
if session.healthy and len(pool) < self.max_pool_size and session not in pool:

0 commit comments

Comments
 (0)