Skip to content

[python] make LogScanner poll methods async to prevent event loop blocking#495

Open
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:feat/async-poll-api
Open

[python] make LogScanner poll methods async to prevent event loop blocking#495
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni:feat/async-poll-api

Conversation

@fresh-borzoni
Copy link
Copy Markdown
Contributor

@fresh-borzoni fresh-borzoni commented Apr 17, 2026

closes #496

Converts LogScanner's poll(), poll_record_batch(), poll_arrow(), to_arrow() and to_pandas() from sync (py.detach + block_on) to async via future_into_py, so scanning no longer blocks the asyncio event loop.

With the public API now async, the private _async_poll and _async_poll_batches helpers are redundant and have been removed. Test fixtures back to session level and don't use global connection caching.

Per-bucket stopping-offset tracking in to_arrow/to_pandas, timeout validation, partition handling and error propagation are preserved.

@fresh-borzoni fresh-borzoni changed the title feat: make LogScanner poll methods async to prevent event loop blocking [python] make LogScanner poll methods async to prevent event loop blocking Apr 17, 2026
Convert poll(), poll_record_batch(), poll_arrow(), to_arrow(), to_pandas()
from sync (py.detach + block_on) to async (future_into_py).

The sync methods blocked the asyncio event loop thread, preventing
concurrent future_into_py tasks from delivering results. This caused
deadlocks when users ran multiple async operations simultaneously.

Breaking change: these methods now return awaitables instead of direct values.
@fresh-borzoni
Copy link
Copy Markdown
Contributor Author

@luoyuxia @leekeiabstraction PTAL 🙏

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.

[python ] LogScanner poll API is sync and blocks the asyncio event loop

1 participant