Skip to content

Incorrect multi-threading synchronization in UpdateDatabaseState#6114

Merged
NinoFloris merged 1 commit intonpgsql:mainfrom
ArtemSerostanov:update_database_state_fix
Oct 29, 2025
Merged

Incorrect multi-threading synchronization in UpdateDatabaseState#6114
NinoFloris merged 1 commit intonpgsql:mainfrom
ArtemSerostanov:update_database_state_fix

Conversation

@ArtemSerostanov
Copy link
Contributor

A small fix for an apparent bug in NpgsqlDataSource.UpdateDatabaseState. The volatile field is being copied into a variable, but then the field is still being accessed later.

@vonzshik vonzshik added this to the 9.0.4 milestone May 22, 2025
@vonzshik vonzshik added the bug label May 22, 2025
Copy link
Contributor

@vonzshik vonzshik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that indeed looks wrong.

Now, this shouldn't be critical as we pretty much always overwrite the state due to passing DateTime.UtcNow as timeStamp, but for the sake of being consistent it's probably better to fix in 9.0 and 8.0.

As for 10.0, I'll probably take a look at removing timeStamp from here.

@roji roji removed the bug label Jun 14, 2025
@roji roji modified the milestones: 9.0.4, 9.0.5 Oct 5, 2025
@NinoFloris NinoFloris merged commit 153b91f into npgsql:main Oct 29, 2025
15 checks passed
NinoFloris pushed a commit that referenced this pull request Oct 29, 2025
…atabaseState() (#6114)

Co-authored-by: Serostanov Artem Sergeevich <aserostanov@ozon.ru>
(cherry picked from commit 153b91f)
@NinoFloris
Copy link
Member

Backported to 9.0.5 via cd9a7ab

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.

5 participants