-
Notifications
You must be signed in to change notification settings - Fork 49
close stream before releasing lock #254
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: cd65c3e 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-254-5535f48Version: You can use this Docker image with the preview package from this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude Code Review
The implementation is correct - calling cancel() before releaseLock() properly terminates HTTP connections when streams are broken early. However, needs a changeset before merge.
Issues:
-
Missing changeset - The existing
.changeset/tough-buttons-arrive.mdis for "Update dependencies", not this fix. Need a new changeset:--- '@cloudflare/sandbox': patch --- Fix stream cleanup by calling cancel() before releaseLock()
-
Comment inconsistency -
sse-parser.ts:75has shorter comment than the other two files. Use the detailed version everywhere for clarity.
Optional: Consider adding a test case for early stream termination (breaking from for await loop).
Verdict: Needs changeset before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude Code Review
The stream cancellation fix is correct. Calling reader.cancel() before reader.releaseLock() properly terminates HTTP connections per Web Streams API spec, which prevents connection leaks when breaking from generators early.
One issue remains from previous review: sse-parser.ts still uses empty catch block instead of the detailed comment used in the other two files. This inconsistency should be fixed.
Verdict: Approve after fixing comment consistency in sse-parser.ts:77
No description provided.