Skip to content

HTTP client leaks PingPongLatencyTimer #2771

@firelizzard18

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions