Skip to content
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

Fix "actor still initializing when getHandler() called" with containers. #3673

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Mar 9, 2025

We observed this error in production when testing containers.

This change was technically composed by Claude Code. Transcript: https://claude-workerd-transcript.pages.dev/ensure-constructed

Claude was surprisingly quick to narrow down where the problem might be, given just the error message.

However, ultimately it needed hints to figure out the actual problem, and the code it initially proposed as the fix was not very good (though its choice to use KJ_ON_SCOPE_FAILURE was interesting!).

The code in this commit may have been written by it, but only after very explicit prompting from me on what to do.

I think I would have found and fixed the problem more quickly without Claude, but its ability to reason about the code is nevertheless impressive.

@kentonv kentonv requested a review from gabivlj March 9, 2025 16:34
@kentonv kentonv requested review from a team as code owners March 9, 2025 16:34
@kentonv kentonv requested review from mikea and jasnell March 9, 2025 16:34
kentonv added 2 commits March 12, 2025 19:20
We observed this error in production when testing containers.

This change was technically composed by Claude Code. Transcript: https://claude-workerd-transcript.pages.dev/ensure-constructed

Claude was surprisingly quick to narrow down where the problem might be, given just the error message.

However, ultimately it needed hints to figure out the actual problem, and the code it initially proposed as the fix was not very good (though its choice to use `KJ_ON_SCOPE_FAILURE` was interesting!).

The code in this commit may have been written by it, but only after very explicit prompting from me on what to do.

I think I would have found and fixed the problem more quickly without Claude, but its ability to reason about the code is nevertheless impressive.
This was pre-existing (before the containers changes). I'm not sure if it would have been possible to trigger in practice, I noticed just from looking at the code.
@kentonv kentonv force-pushed the kenton/fix-ensure-constructed-race branch from 6d06ee6 to a687be1 Compare March 13, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants