Skip to content

Commit 4501da2

Browse files
committed
Dispose CancellationTokenSource
This commit disposes the CancellationTokenSource when diposing the BulkAllObservable<T>. Since the CancellationTokenSource could be linked to a passed CancellationToken that sets a timeout, not disposing it can lead to flooding the timer queue, affecting performance.
1 parent 011300d commit 4501da2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Nest/Document/Multiple/BulkAll/BulkAllObservable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public void Dispose()
200200
{
201201
this.IsDisposed = true;
202202
this._compositeCancelTokenSource?.Cancel();
203+
this._compositeCancelTokenSource?.Dispose();
203204
}
204205
}
205206
}

0 commit comments

Comments
 (0)