Skip to content

Commit dadb378

Browse files
committed
chore: Remove early exit of the exporter
Allow for slow thread startup to process exports if the processor is shut down quickly
1 parent 3312a41 commit dadb378

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/OpenTelemetry/Internal/BatchExportTaskWorker.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ internal sealed class BatchExportTaskWorker<T> : BatchExportWorker<T>
1717
private readonly TaskCompletionSource<bool> shutdownCompletionSource = new();
1818
private TaskCompletionSource<bool> dataExportedNotification = new();
1919
private Task? workerTask;
20-
private volatile bool isShutdownRequested;
2120
private bool disposed;
2221

2322
/// <summary>
@@ -100,7 +99,6 @@ public override bool WaitForExport(int timeoutMilliseconds)
10099
public override bool Shutdown(int timeoutMilliseconds)
101100
{
102101
this.SetShutdownDrainTarget(this.circularBuffer.AddedCount);
103-
this.isShutdownRequested = true;
104102

105103
try
106104
{
@@ -207,7 +205,7 @@ private async Task ExporterProcAsync()
207205

208206
try
209207
{
210-
while (!cancellationToken.IsCancellationRequested && !this.isShutdownRequested)
208+
while (true)
211209
{
212210
// only wait when the queue doesn't have enough items, otherwise keep busy and send data continuously
213211
if (this.circularBuffer.Count < this.maxExportBatchSize)

0 commit comments

Comments
 (0)