Skip to content

Request timeouts #13

@kimburgess

Description

@kimburgess

When performing any inter-module comms or interaction with modules via the websocket API, requests have no upper bound for resolution. This becomes more evident where logic modules may be combining async interactions across multiple devices as the failure of one request to resolve can cause multiple subsequent event chains to halt and associated callbacks to remain in memory. This can be worked around in user code, but it may be neater / nicer to shift it upstream so it doesn't need to be thought about and clutter logic.

I'd recommend that we race the promise returned by Orchestrator::Core::RequestForward#request against a timer with a sane upper limit - say 5 minutes - after which it rejects with :timeout. This should act as a neat background cleanup task.

Cases where a shorter guaranteed responses are needed (e.g. websocket responses for UI updates) can still be handled in user code with a separate race, with this still in the background as a safety net.

Possible negative impacts are it would prevent modules from performing async interactions where the response time is > whatever timeout value is chosen. I can't think of many use cases for this though.

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