[python] make LogScanner poll methods async to prevent event loop blocking#495
Open
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
Open
[python] make LogScanner poll methods async to prevent event loop blocking#495fresh-borzoni wants to merge 1 commit intoapache:mainfrom
fresh-borzoni wants to merge 1 commit intoapache:mainfrom
Conversation
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.
cc1a402 to
55ea1b2
Compare
Contributor
Author
|
@luoyuxia @leekeiabstraction PTAL 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.