Skip to content

Conversation

@jasnell
Copy link
Collaborator

@jasnell jasnell commented Nov 4, 2025

This is a second attempt since we had to revert the first one.

This is not yet ready to land. It needs a test but I've been unable to reproduce the failure we saw in production with the original version.

This is a second attempt since we had to revert the first one
@jasnell jasnell requested a review from harrishancock November 4, 2025 21:00
// An optimized pumpTo... we know we have all the data right here. We can
// just write it all at once up to `amount`.
uint64_t toRead = kj::min(data.size(), amount);
KJ_DEFER(advance(toRead));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for @harrishancock: I think this is actually the bit that caused the problem we saw in prod. The advance call would drop the ownedBacking once all the data was read. I think, however, that it was being dropped at the wrong time. The original BodyBufferInputStream did not drop the backing until the stream was destroyed. I've been unable to reproduce the specific failure we saw tho.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does sound likely. Essentially we were inadvertently dropping a V8 object outside of the isolate lock?

@codspeed-hq

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants