You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Npgsql 100% reliable in the face of accidental concurrent use #3701
Like other ADO.NET providers, Npgsql does not allow using the same connection concurrently - doing so is a user bug. Npgsql does have some concurrency detection protection (where we throw NpgsqlOperationInProgressException with relevant information), but it's incomplete; so over the years we've received quite a few issues where users got random undefined behavior, and needed to spent quite some time tracking down the bug etc.
Ideally, Npgsql would be 100% reliable, always throwing NpgsqlOperationInProgressException; this would both help our users, and save us time analyzing issues around undefined behavior.
Some notes:
Opening and closing specifically isn't protected at the moment (a bit tricky since at NpgsqlConnection.Open there's no NpgsqlConnector yet to lock on, etc.)
We're probably not 100% tight around concurrency with the keepalives we generate; this would be a real Npgsql bug rather than a user bug - but it seems related enough.
Activity
wkwiecien-fp commentedon Nov 8, 2023
roji commentedon Nov 8, 2023