madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.74k stars 182 forks source link

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

Closed madelson closed 5 days ago

madelson commented 5 days 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.