madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.92k stars 198 forks source link

Rare race condition with keepalive after upgrading to Npgsql 8.0.3 #216

Closed madelson closed 5 months ago

madelson commented 5 months ago

See https://github.com/madelson/DistributedLock/pull/209#issuecomment-2133539610

The root cause is Npgsql's command re-use, which means that NpgsqlConnection.CreateCommand() is not thread-safe.