Skip to content

HeartbeatSlow trace is called with incorrect arguments order #28660

Closed

Description

@mariopasquali

Describe the bug

I get the following log line:

Kestrel: As of "00:00:02.3507376", the heartbeat has been running for "00:00:01" which is longer than "12/15/2020 07:02:37 +00:00". This could be caused by thread pool starvation.

The order of the arguments is incorrect.

In file src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs:

        private static readonly Action<ILogger, TimeSpan, TimeSpan, DateTimeOffset, Exception?> _heartbeatSlow =
            LoggerMessage.Define<TimeSpan, TimeSpan, DateTimeOffset>(LogLevel.Warning, new EventId(22, "HeartbeatSlow"), @"As of ""{now}"", the heartbeat has been running for ""{heartbeatDuration}"" which is longer than ""{interval}"". This could be caused by thread pool starvation.");

is defined with order "now, heartbeatDuration, interval"

        public virtual void HeartbeatSlow(TimeSpan heartbeatDuration, TimeSpan interval, DateTimeOffset now)
        {
            _heartbeatSlow(_logger, heartbeatDuration, interval, now, null);
        }

is invoked with order "heartbeatDuration, interval, now"

Activity

  1. BrennanConroy commented on Jan 8, 2021

    @BrennanConroy
    Member

    Done via #28698

  2. ghost locked as resolved and limited conversation to collaborators on Feb 7, 2021
  3. added
    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
    and removed on Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsgood first issueGood for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions