Skip to content

http_json_handler: Don't have err failed to write response log entire error  #119

Open

Description

@jmalicevic

This is originally by Dev posted in informalsystems/tendermint:

informalsystems/tendermint/issues/1

Summary

There are many causes of failed to write response errors in this file: https://github.com/tendermint/tendermint/blob/v0.34.24/rpc/jsonrpc/server/http_json_handler.go#L19-L129

One of these frequently leads to massive "log bombs", that spans thousands of characters and crowds out all content in the CLI logs (and looks quite concerning)

 Nov 17 01:49:48 <node_name> cosmovisor[1541013]: 1:49AM ERR failed to write responses err="write tcp 127.0.0.1:26657->127.0.0.1:34266: i/o timeout" module=rpc-server res=[{"id":998254319713,"jsonrpc":"2.0","result":{"total_count":"329048","txs":$MASSIVE_AMOUNT_OF_TEXT

There are some \n characters in this output that end up breaking into multiple lines as well, and breaking parsing formats.

Can we make a smaller result serialization here, that just has a truncated / trimmed amount of data, that gets output to the CLI?

This would significantly reduce the size of logs, and the amount of information that can be easily gleaned by scrolling through them.

Activity

  1. cason commented on Jan 16, 2023

    @cason

    More comprehensively, I think we should prevent any blob, arbitrary/unstructured data content, from being printed to the logs.

  2. added
    logs
    on Jan 17, 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

    logs

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions