Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13475

OutOfMemory error caused by SSL webhook endpoints with large responses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 7.21.0
    • Webhooks

    Description

      Issue Summary

      If a Bitbucket Server webhook is configured with an endpoint that uses SSL and produces a response body size greater than the configured plugin.webhooks.response.http.body.size.max value (defaults to 16384 bytes), a bug occurs where resources linked to the webhook response are not released. These resources accumulate over time and may eventually cause an OutOfMemory error.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. You'll need to have access to a webhook endpoint that is set up with SSL. Ensure this endpoint consistently has a response body size greater than the configured plugin.webhooks.response.http.body.size.max value (defaults to 16384 bytes).
      2. Create a webhook using the endpoint specified in the previous step.
      3. Trigger the webhook multiple times.
      4. Generate a heap dump for the JVM process that Bitbucket is running in and inspect instances of BaseIOReactor class with the largest sizes.

      Expected Results

      The bufferingSessions set of the BaseIOReactor instances should be empty.

      Actual Results

      The BaseIOReactor.bufferingSessions items accumulate over time and are never released, which eventually leads to an OOM error.

      Workaround

      If possible, reduce the webhook response size within the configured plugin.webhooks.response.http.body.size.max value.

      Attachments

        Activity

          People

            Unassigned Unassigned
            74d6667aa35c Josh Aguilar
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: