-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ProgrammingError on async race condition when using pool execute many #71
Comments
I encountered the same issue. |
Same issue |
same |
I'm hitting this during ClickHouse server updates, when the connection gets dropped by the database. Always have to restart my application to recover from this. Can confirm it happens with normal execute, not just executemany. |
For the time being, while these changes haven't been released, you can check this snippet of code pool: Pool | None = None
@contextlib.asynccontextmanager
async def with_clickhouse(**kwargs):
global pool
pool = await asynch.create_pool(**kwargs)
try:
yield pool
finally:
pool.close()
await pool.wait_closed()
pool = None
@contextlib.asynccontextmanager
async def session_scope() -> DictCursor:
if pool is None:
raise RuntimeError('out of `with_clickhouse()` scope')
async with pool.acquire() as conn:
try:
async with conn.cursor() as cursor:
yield cursor
finally:
if conn._connection.is_query_executing:
await conn._connection.disconnect() |
gnomeby
added a commit
to vizor-games/asynch
that referenced
this issue
Mar 21, 2024
Fix for correct checking disconnected connections: #98 |
gnomeby
added a commit
to vizor-games/asynch
that referenced
this issue
Mar 21, 2024
…eck_life_connection long2ice#71 Correct check life connection
long2ice
added a commit
that referenced
this issue
Apr 22, 2024
…e_connection #71 Correct check life connection
Merged
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
when using execute many to insert multiple entries into clickhouse with the following code to rapidly insert records:
we get the following exeption:
ProgrammingError("records have not fetched, fetch all before execute next")
probably also an issue with a single execute
The text was updated successfully, but these errors were encountered: