-
Notifications
You must be signed in to change notification settings - Fork 46
Fix executor mutex race condition and memory leak #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 9ceaa8e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
🐳 Docker Image PublishedFROM cloudflare/sandbox:0.0.0-pr-258-2e2af2dVersion: You can use this Docker image with the preview package from this PR. |
|
@claude can you fix the issues raised in the code review comments |
|
Claude finished @ghostwriternr's task —— View job Fixed Code Review Issues ✓All three issues from the code review have been fixed and pushed: Changes Made
Verification
The memory leak fixes are now complete. The mutex cleanup now happens in all process termination paths:
|
Added executorLocks.delete() calls in cleanupIdleProcesses() and shutdown() to prevent memory leaks. Also clarified comment in releaseExecutorForContext(). Co-authored-by: Naresh <[email protected]>
Summary
Fixes race condition in
getExecutorLock()where concurrent calls could create duplicate mutex instances, defeating serialization. Also fixes memory leak where executor mutexes weren't cleaned up on process exit.Test plan
globalThis