Skip to content

HTTP client leaks PingPongLatencyTimer #2771

Description

@firelizzard18

Bug Report

What happened?

rpc/jsonrpc/client.WSClient starts a github.com/rcrowley/go-metrics.Timer but never closes it, thus rpc/client/http.HTTP leaks.

What did you expect to happen?

Either:

  • Some method on HTTP that releases the timer; or
  • The timer is released when HTTP.Stop is called and not allocated in the first place unless HTTP.Start is called.

How to reproduce it

Call rpc/client/http.NewClient.

Anything else we need to know

Besides the field definition and initialization, PingPongLatencyTimer is only referenced once: c.PingPongLatencyTimer.UpdateSince(t). There are no calls to c.PingPongLatencyTimer.Stop(). More significantly, it isn't used by anything. PingPongLatencyTimer appears to be dead code. It could be completely removed without affecting Tendermint.

Activity

  1. added
    bug
    needs-triage
    on Apr 10, 2024
  2. added a commit that references this issue on Apr 12, 2024
    3d736a3
  3. added 2 commits that reference this issue on Apr 12, 2024
    5ba8082
    62c5a01
  4. added 2 commits that reference this issue on Apr 12, 2024
    3872582
    e5cf488
  5. added a commit that references this issue on Apr 15, 2024
    312d1d4
  6. added 2 commits that reference this issue on Apr 15, 2024
    4ac27bf
    0103516
  7. added 2 commits that reference this issue on Apr 15, 2024
    365d4e4
    9875622
  8. removed
    needs-triage
    on Apr 16, 2024
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions