Skip to content

ScatterGatherApi polutes logs with non gracefully handled TaskCanceledException (4.32.2) #3758

@ramonsmits

Description

@ramonsmits

Describe the bug

Version: 4.32.2

When an instance is not available or time out the following is logged:

2023-10-18 13:21:43.0589|69|Warn|ServiceControl.CompositeViews.Messages.ScatterGatherApi`2[[ServiceControl.Persistence.IEndpointInstanceMonitoring, ServiceControl.Persistence, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.IList`1[[ServiceControl.Persistence.KnownEndpointsView, ServiceControl.Persistence, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]|Failed to query remote instance at http://adtqmon04.teleena.local:44448/api.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ServiceControl.CompositeViews.Messages.ScatterGatherApi`2.<FetchAndParse>d__17.MoveNext() in /_/src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs:line 114

These TaskCanceledException should be gracefully handled to only report a single one line log entry like:

2023-10-18 13:21:43.0589|69|Warn|ServiceControl.CompositeViews.Messages.ScatterGatherApi|Failed to query remote instance at http://adtqmon04.teleena.local:44448/api: A task was canceled.

Steps to reproduce

  1. Setup instance
  2. Stop audit instance
  3. Invoke scatter gather API

Relevant log output

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions