Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-2252

PuppetDB should not be slurping all request bodies to a string

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 3.2.2
    • Fix Version/s: PDB 4.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      PuppetDB 2016-01-13, PuppetDB 2016-01-27

      Description

      Currently we are always slurping the full InputStream in the body of the request into a String (see here for the code). This is being done on ALL incoming requests. This is bad for several reasons. One is with the new code that rejects payloads that are too large. If we always slurp it in, we could get a payload too large for the String of it to fit in memory. If we need to parse the JSON, it's much better to just pass in the stream. If we can avoid converting to a string entirely (i.e. transfer the data to AMQ in raw bytes) that's even better.

      After this is fixed, we should be able to accept arbitrarily large POST bodies and reject them properly. This should also be faster and more memory efficient.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ryan.senior Ryan Senior
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support