Skip to content

Commit 4d7697e

Browse files
idempotent DisposeAsync
1 parent e4e3763 commit 4d7697e

File tree

1 file changed

+5
-0
lines changed
  • src/Ydb.Sdk/src/Services/Topic/Writer

1 file changed

+5
-0
lines changed

src/Ydb.Sdk/src/Services/Topic/Writer/Writer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ private async Task Initialize()
333333

334334
public async ValueTask DisposeAsync()
335335
{
336+
if (_disposeCts.IsCancellationRequested)
337+
{
338+
return;
339+
}
340+
336341
_logger.LogInformation("Starting Writer[{WriterConfig}] disposal process", _config);
337342

338343
await _sendInFlightMessagesSemaphoreSlim.WaitAsync();

0 commit comments

Comments
 (0)