ProcedureCallError: preserve distinction between guest and host errors - #5855
Open
mahmudsudo wants to merge 2 commits into
Open
ProcedureCallError: preserve distinction between guest and host errors#5855mahmudsudo wants to merge 2 commits into
mahmudsudo wants to merge 2 commits into
Conversation
Signed-off-by: TheRustFanatic <75342173+mahmudsudo@users.noreply.github.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Addresses #5660 (follow-up from #5640).
Previously,
ProcedureCallErrorcombined all execution failures intoInternalError(String), lumping guest module panics/traps together with host internal errors. Consequently, procedure error logging in the HTTP API handler was temporarily downgraded tolog::info!to avoid false positive host alerts triggered by guest panics.This PR:
GuestPanic(String)variant toProcedureCallErrorincrates/core/src/host/module_host.rs.InstanceCommon::call_procedureincrates/core/src/host/wasm_common/module_host_actor.rsto returnProcedureCallError::GuestPanicwhen guest execution encounters a panic/trap, while preservingProcedureCallError::InternalErrorfor host-side failures (such as return value deserialization failure).map_procedure_errorincrates/client-api/src/routes/database.rsto:ProcedureCallError::GuestPanicatlog::debug!level (preventing false alarm host alerts).ProcedureCallError::InternalErroratlog::error!level (ensuring host alerts fire on internal host failures).test_map_procedure_error_distinguishes_guest_panic_and_internal_error.API and ABI breaking changes
No breaking changes to the external client wire protocol or HTTP status codes. Internal Rust enum
ProcedureCallErrorinspacetimedb_core::hostreceived an additionalGuestPanicvariant.Expected complexity level and risk
1 - Low risk, targeted error variant separation and log level correction.
Testing
test_map_procedure_error_distinguishes_guest_panic_and_internal_errorincrates/client-api/src/routes/database.rsProcedureCallErrorvariant handling and log levels