diff --git a/libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs b/libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs
index d5fc8d993c..e28b04af4d 100644
--- a/libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs
+++ b/libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license.
using System;
-using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
@@ -739,19 +738,6 @@ public void ResetModified(ref Key key)
#region Pending Operations
- ///
- /// Get list of pending requests (for current session)
- ///
- ///
- public IEnumerable GetPendingRequests()
- {
- foreach (var kvp in ctx.prevCtx?.ioPendingRequests)
- yield return kvp.Value.serialNum;
-
- foreach (var kvp in ctx.ioPendingRequests)
- yield return kvp.Value.serialNum;
- }
-
///
public bool CompletePending(bool wait = false, bool spinWaitForCommit = false)
=> CompletePending(false, wait, spinWaitForCommit);
diff --git a/libs/storage/Tsavorite/cs/src/core/ClientSession/LockableContext.cs b/libs/storage/Tsavorite/cs/src/core/ClientSession/LockableContext.cs
index 5732dd1389..c7fae795e9 100644
--- a/libs/storage/Tsavorite/cs/src/core/ClientSession/LockableContext.cs
+++ b/libs/storage/Tsavorite/cs/src/core/ClientSession/LockableContext.cs
@@ -137,9 +137,8 @@ internal static bool DoInternalTryLock(Tsavorite
continue; // Success; continue to the next key.
}
- // Cancellation or lock failure before we've completed all keys; we may or may not have locked the current key. Unlock anything we've locked.
- var unlockIdx = keyIdx - (status == OperationStatus.SUCCESS ? 0 : 1);
- DoInternalUnlock(clientSession, keys, start, unlockIdx);
+ // Cancellation or lock failure before we've completed all keys; we have not locked the current key. Unlock anything we've locked.
+ DoInternalUnlock(clientSession, keys, start, keyIdx - 1);
// Lock failure is the only place we check the timeout. If we've exceeded that, or if we've had a cancellation, return false.
if (cancellationToken.IsCancellationRequested || DateTime.UtcNow.Ticks - startTime.Ticks > timeout.Ticks)