Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.47.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://github.com/mstrokin/sentry-openfiles-bug
Steps to Reproduce
Running this in a Node Express server opens same files repeatedly without ever closing them, since 8.10.0 (8.9.0 works fine).
for (var i = 0; i < 1000; i++) {
Sentry.captureException('fake exception to test the files opening');
}
This is the cause of it: #12221
const stream = createReadStream(path);
this stream never gets closed (even though it supposed to use autoClose I think)
Expected Result
There are no open files in lsof output after sending the exceptions.
Actual Result
New files are opened every time captureException is called.