Skip to content

Commit

Permalink
Merge pull request #1333 from cisagov/za/fix-multiple-pool-objects
Browse files Browse the repository at this point in the history
EPP Connection Pool fix
  • Loading branch information
zandercymatics authored Nov 14, 2023
2 parents 778fbdb + 430156d commit f0847ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/epplibwrapper/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_connection_success(self):
self.client.connect()
response = self.client.send(self.login)
except LoginError as err:
if err.should_retry() and counter < 3:
if err.should_retry() and counter < 10:
counter += 1
sleep((counter * 50) / 1000) # sleep 50 ms to 150 ms
else: # don't try again
Expand Down
4 changes: 2 additions & 2 deletions src/epplibwrapper/utility/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_connections(self):
def kill_all_connections(self):
"""Kills all active connections in the pool."""
try:
if len(self.conn) > 0:
if len(self.conn) > 0 or len(self.greenlets) > 0:
gevent.killall(self.greenlets)

self.greenlets.clear()
Expand All @@ -116,7 +116,7 @@ def populate_all_connections(self):
If any connections exist, kill them first.
Based off of the __init__ definition for geventconnpool.
"""
if len(self.conn) > 0:
if len(self.conn) > 0 or len(self.greenlets) > 0:
self.kill_all_connections()

# Setup the lock
Expand Down

0 comments on commit f0847ab

Please sign in to comment.