Skip to content

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

Description

@fresh-borzoni

Search before asking

  • I searched in the issues and found nothing similar.

Description

LogScanner's poll(), poll_record_batch(), poll_arrow(), to_arrow() and to_pandas() are synchronous and internally do py.detach + block_on. Because they run on the event loop thread, concurrent future_into_py tasks can't make progress while a poll is in flight, which causes intermittent deadlocks when users mix scanning with other async operations. It's also inconsistent with the rest of the Python API, which is fully async.

Convert these five methods to async via future_into_py. This is a breaking change - they return awaitables. All call sites, examples, docs and type stubs need updating. The private _async_poll helpers used by aiter become redundant once this lands and should be removed, and the function-scoped test fixtures added in #494 (a workaround for the blocking loop) can be reverted.

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions