Skip to content

@sentry/solidstart before response middleware memory leak #13924

@paularmstrong

Description

@paularmstrong

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/solidstart

SDK Version

8.33.0

Framework Version

Solid ^1.9.2, @solidjs/start @^1.0.8

Link to Sentry event

No response

Reproduction Example/SDK Setup

With sentryBeforeResponseMiddleware() in onBeforeResponse, we're seeing memory leaks, particularly on the request event.

import { createMiddleware } from '@solidjs/start/middleware';
import { sentryBeforeResponseMiddleware } from '@sentry/solidstart';

export default createMiddleware({
  onBeforeResponse: [sentryBeforeResponseMiddleware()]
});

Steps to Reproduce

  1. Add middleware
  2. Run the server with node --inspect
  3. take a memory snapshot in the node inspector
  4. Run a bench against the server, eg ab -n 100 -c 5 http://localhost:3000
  5. take another memory snapshot

Expected Result

No memory leak

Actual Result

Memory leak… the request events are held onto and eventually exhaust the memory limit of the server, causing it to crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions