Skip to content

Commit 16a3f0d

Browse files
fix: minor fix to avoid pool exhaustion and deadlocks (#3958)
Signed-off-by: Vinay Singh <vinay@verid.id>
1 parent b573f0f commit 16a3f0d

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

  • acapy_agent/database_manager/databases/postgresql_normalized

acapy_agent/database_manager/databases/postgresql_normalized/session.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ def translate_error(self, error: Exception) -> DBStoreError:
128128
)
129129

130130
async def _get_profile_id(self, profile_name: str) -> int:
131-
conn = await self.pool.getconn()
132131
try:
133-
async with conn.cursor() as cursor:
132+
async with self.conn.cursor() as cursor:
134133
await cursor.execute(
135134
f"SELECT id FROM {self.schema_context.qualify_table('profiles')} "
136135
f"WHERE name = %s",
@@ -153,9 +152,6 @@ async def _get_profile_id(self, profile_name: str) -> int:
153152
message=f"Failed to retrieve profile ID for '{profile_name}'",
154153
actual_error=str(e),
155154
)
156-
finally:
157-
await conn.rollback()
158-
await self.pool.putconn(conn)
159155

160156
async def __aenter__(self):
161157
"""Enter async context manager."""

0 commit comments

Comments
 (0)