Skip to content

HeartbeatSlow trace is called with incorrect arguments order #28660

@mariopasquali

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"

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