Skip to content

Distinguish V1 WebSocket execution errors #5682

Description

@JasonAtClockwork

Follow-up from #5640. We should audit the errors entering MessageExecutionError to preserve classification to distinguish between module/guest errors from lifecycle or internal database failures.

Details


In [crates/client-api/src/routes/subscribe.rs] around line 852, we have the following block:

...
    while let Some((data, timer)) = recv_handler.next().await {
        let result = message_handler(data, timer).await;
        if let Err(e) = result {
            if ws_version == WsVersion::V1
                && let MessageHandleError::Execution(err) = e
            {
                // TODO: Review log level after guest/client execution errors can be distinguished from internal failures.
                log::warn!("{err:#}");
                // If the send task has exited, also exit this recv task.
                if unordered_tx.send(err.into()).is_err() {
                    break;
                }
                continue;
            }
...

Currently using warn! as a conservative default. It appears that this shared error path will combine invalid reducers/reducer arguments, invalid one-off queries with internal worker or database failures. If we can maintain a classification we can more appropriately change the logging behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions