I got contacted by someone from my team that INSERTs were failing on one of our database instances. A look at Application Insights showed the following error message in the logs:
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
For an unknown reason, the transaction timeout before it could be committed resulting in a rollback operation and a failing INSERT. Time to open SQL Server Management Studio and first take a look at the Resource Locking Statistics by Objects report:
Indeed, multiple sessions share a lock on the same table. If you want, you can also check the User Statistics report to find out what these sessions are related to:
To fix the issue, I killed the sessions that were causing the lock:
KILL 236
KILL 210
KILL 257
After doing that, I could confirm that the locking was gone by refreshing the report: