Skip to content

OOM when deserializing too large of a eval response #54

@ghost

Description

If you run a command that causes the playground to respond with a Very Large amount of data (like ?eval [(); 1_000_000]), then formatting that will OOM the bot because the response size is not limited.

Reqwest has seanmonstar/reqwest#1234 which seems to be "no there is no easy API for it", but we could move from .json() to using https://docs.rs/reqwest/latest/reqwest/struct.Response.html#method.chunk which you could loop and read into a local Vec, and bail out if that vec gets too large (over 1MB?). And/or check the content-length?

Context: https://discord.com/channels/273534239310479360/818964227783262209/1018843827739574302

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions