Skip to content

Conversation

@kgala2
Copy link
Collaborator

@kgala2 kgala2 commented Apr 7, 2025

Draft-PR to check if the connector's been closed before trying to connect using the same engine.

  1. Throws error if the connector has been closed
  2. Continues to connect otherwise

self._loop.call_soon_threadsafe(self._loop.stop)
# wait for thread to finish closing (i.e. loop to stop)
self._thread.join()
self._closed = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not necessary as synchronous close calls close_async so should get closed by close_async

@kgala2 kgala2 force-pushed the error-on-closed-connection branch from 2629802 to b8bc912 Compare May 16, 2025 23:11
await asyncio.gather(*[cache.close() for cache in self._cache.values()])
if self._client:
await self._client.close()
self._closed = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do this first, then client.close(), then gather cache.close()

@kgala2 kgala2 marked this pull request as ready for review December 16, 2025 17:25
@kgala2 kgala2 requested a review from a team as a code owner December 16, 2025 17:25
@kgala2 kgala2 merged commit ae7db85 into main Dec 16, 2025
17 checks passed
@kgala2 kgala2 deleted the error-on-closed-connection branch December 16, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants