Skip to content

Statement::Finalize blocks nodejs event loop #1394

Open
@alex3d

Description

@alex3d

Statement::Finalize runs entirely in main/event loop thread and could block event loop on sqlite3_finalize (if some other query currently executing in libuv thread pool). sqlite3_finalize should be called only from thread pool as any other sqlite3_ functions.

Wall clock profiling flamegraph:
image

I could make PR if there is no rationale to run sqlite3_finalize in event loop thread.

Activity

daniellockyer

daniellockyer commented on Jul 31, 2022

@daniellockyer
Contributor

@alex3d I'd love to see a PR 🙂

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alex3d@daniellockyer

        Issue actions

          Statement::Finalize blocks nodejs event loop · Issue #1394 · TryGhost/node-sqlite3