Skip to content

Running both asynchronous and synchronous queries at the same time causes transaction to fail #4

@wyozi

Description

@wyozi

Basically doing the following causes both of the queries to run at the same time, and hence causing the synchronous transaction to fail due to the async query's transaction being open.

local asyncQ = pg:query("do something that takes a while");
asyncQ:run()

local syncQ = pg:query("SELECT 1");
syncQ:set_sync(true)
local b, reason = syncQ:run()
assert(b == false)
-- reason = Started transaction<READ COMMITTED> while transaction<READ COMMITTED> still active

This is quite a corner case, and will be solved for me as well when I'm able to safely migrate all queries to use asynchronous mode, but thought I'd report it anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions