Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/MongoDb/Synchronization/DistributedLockThingy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public async Task<IDistributedLock> AcquireAsync(DistributedLockDefinition lockD
{
if (!await InnerTryAcquireAsync(internalLockDefinition, ct))
{
LogTryAcquireNotSuccessful(logger, lockDefinition.Id, lockDefinition.Context);
await internalLockDefinition.ChangeStreamNotifier.TryDisposeAsync();
return null;
}
Expand Down Expand Up @@ -300,6 +301,8 @@ private TimeSpan GetRemainingTime(InternalDistributedLockDefinition lockDefiniti
[LoggerMessage(LogLevel.Debug, Message = "Lock acquired (id \"{Id}\" context \"{Context}\")")]
private static partial void LogAcquired(ILogger logger, string id, string? context);

[LoggerMessage(LogLevel.Debug, Message = "Lock try acquire did not succeed, another instance is holding it (id \"{Id}\" context \"{Context}\")")]
private static partial void LogTryAcquireNotSuccessful(ILogger logger, string id, string? context);

[LoggerMessage(LogLevel.Warning,
Message = "An error occurred while acquiring lock (id \"{Id}\" context \"{Context}\")")]
Expand Down
Loading