Skip to content

Make broken prefix before jsg.Error for event timeouts. #1731

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

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

jqmmes
Copy link
Contributor

@jqmmes jqmmes commented Feb 26, 2024

This PR changes prefix ordering for event timeout error messages, ensuring the brokenness reason comes before the jsg.Error.

We do this also in:

void DurableObjectState::abort(jsg::Optional<kj::String> reason) {
kj::String description = kj::mv(reason).map([](kj::String&& text) {
return kj::str("broken.outputGateBroken; jsg.Error: ", text);
}).orDefault([]() {
return kj::str("broken.outputGateBroken; jsg.Error: Application called abort() to reset "
"Durable Object.");
});
kj::Exception error(kj::Exception::Type::FAILED, __FILE__, __LINE__, kj::mv(description));
KJ_IF_SOME(s, storage) {
// Make sure we _synchronously_ break storage so that there's no chance our promise fulfilling
// will race against the output gate, possibly allowing writes to complete before being
// canceled.
s.get()->getActorCacheInterface().shutdown(error);
}
IoContext::current().abort(kj::cp(error));
kj::throwFatalException(kj::mv(error));
}

@jqmmes jqmmes requested review from a team as code owners February 26, 2024 12:58
@jqmmes jqmmes requested review from mikea and jp4a50 February 26, 2024 12:58
@jqmmes jqmmes merged commit 834ee21 into main Feb 26, 2024
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