Skip to content

Conversation

@levkk
Copy link
Collaborator

@levkk levkk commented Feb 9, 2026

Race condition fix

Fixes race condition with sequelize and other similar ORMs that do the following:

Parse
Describe
Flush
Bind
Execute
Flush

We treated this as query is finished and let our pool logic send Sync asynchronously as a cleanup step. Meanwhile, Sequelize would send Sync separately and we would immediately return ReadyForQuery, but the cleanup is async and would happen after we responded with ReadyForQuery. The client then thought a record was created before it was actually saved in Postgres. This is a likely fix for #685 cc @mkreidenweis-schulmngr

Multiple SET statements

Sequelize also sends multiple SET commands in one query. We handle this now correctly, although it's not related to the race condition.

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 95.77465% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/frontend/router/parser/query/set.rs 92.75% 5 Missing ⚠️
.../src/frontend/router/parser/query/test/test_set.rs 93.44% 4 Missing ⚠️
.../frontend/router/parser/query/test/test_special.rs 88.88% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@levkk levkk merged commit 271303d into main Feb 10, 2026
8 checks passed
@levkk levkk deleted the levkk-fix-race branch February 10, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant