8000 End open Arrow results after the re-entrancy guard, not before it · Issue #211 · krlmlr/duckdb-r · GitHub
[go: up one dir, main page]

Skip to content

End open Arrow results after the re-entrancy guard, not before it #211

Open

Description

@krlmlr

Moved from duckdb#2936, opened by krlmlr on 2026-10-17. Earlier discussion stays there.

Found in the clean-context review of the v2.0 landing's R side (duckdb#2924, carried into duckdb#2926). Applies to the glue as main will have it after the landing.

Before a statement runs, the glue ends the Arrow results still open on its connection (EndOpenResults()), then creates a ScopedInterruptHandler, which also guards against re-entrant calls, for instance from a progress bar callback, by throwing "ScopedInterruptHandler already active". In src/statement.cpp (rapi_prepare(), rapi_execute()) and src/register.cpp (register and unregister) the order is EndOpenResults() first, so a re-entrant call ends the connection's open results before it is refused. Harmless today, since such a call fails anyway, but the refusal should come first.

Suggested fix: create the handler, or check ScopedInterruptHandler::IsActiveFor(), before calling EndOpenResults(), as GetQueryResult() in src/reltoaltrep.cpp already does.

🤖 Generated with Claude Code

https://claude.ai/code/session_016eMMBKnK3cvLjYLeP4bB3v


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0