Skip to content

Commit ee578a2

Browse files
fixed race condition
1 parent 208f14d commit ee578a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Ydb.Sdk/src/Ado/Session/ImplicitSessionSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private bool TryAcquireLease()
3838
if (Volatile.Read(ref _isDisposed) == 0)
3939
return true;
4040

41-
Interlocked.Decrement(ref _activeLeaseCount);
41+
ReleaseLease();
4242
return false;
4343
}
4444

src/Ydb.Sdk/test/Ydb.Sdk.Ado.Tests/Session/YdbImplicitStressTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private IDriver DummyDriver()
2020
}
2121

2222
[Fact]
23-
public async Task Dispose_WaitsForAllLeases_AndSignalsOnEmptyExactlyOnce()
23+
public async Task StressTest_OpenSession_RaceWithDispose_SuccessfulOpensAreNotDisposed()
2424
{
2525
for (var it = 0; it < 1000; it++)
2626
{

0 commit comments

Comments
 (0)