Skip to content

[BUG] LogsIngestionClient does not use its ThreadPool for processing #41091

@FelixStumvollDT

Description

@FelixStumvollDT

Describe the bug
I was looking at the source code of the LogsIngestionClient, since i was wondering why it implements the AutoClosable interface.
I noticed it creates an ExecutorService instances, that has to be shut down. However, upon closer inspection i saw that this ExecutorService is not used for any processing. Only here are tasks submitted to it, and the passed tasks immediately returns the Stream instance, which is essentially a no-op.

Code Snippet
The relevant code is in the submit method of the LogsIngestionClient:

private Stream<UploadLogsResponseHolder> submit(Stream<UploadLogsResponseHolder> responseStream, int concurrency) {
    if (concurrency == 1) {
        return responseStream;
    }

    try {
        return threadPool.submit(() -> responseStream).get();
    } catch (InterruptedException | ExecutionException e) {
        throw LOGGER.logExceptionAsError(new RuntimeException(e));
    }
}

Setup (please complete the following information):

  • OS: -
  • IDE: -
  • Library/Libraries: com.azure:azure-monitor-ingestion:1.2.2
  • Java version: 21
  • App Server/Environment: -
  • Frameworks: -

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.MonitorMonitor, Monitor Ingestion, Monitor QuerybugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions