Skip to content

Feature: Replace custom request holding with Sablier Middleware #71

@BeSovereign

Description

@BeSovereign

Description

Currently, when a sleeping app is accessed, the Freeshard controller intercepts the request, holds it, uses Docker to start the container(s), and forwards the traffic once the app is up. This custom "hanging request" logic can be standardized and optimized.

We should replace the custom request holding with Sablier, a Traefik middleware specifically designed for on-demand container execution.

Proposed Changes

  1. Traefik Integration: Integrate the Sablier middleware into our Traefik reverse proxy configuration.
  2. Blocking Strategy: Configure Sablier to use the blocking strategy with a defined timeout to intercept requests targeting inactive containers.
  3. Controller Hook: Hook Sablier into the Freeshard controller (or the Docker API) to trigger the container start process.
  4. Health-Check Polling: Delegate the health-check polling to Sablier so it automatically releases the proxy request to the backend as soon as the container is ready.

Motivation

Delegating the network holding complexity to a dedicated Traefik middleware reduces our own codebase maintenance. More importantly, Sablier provides the necessary network-layer foundation to be coupled with CRIU, which will solve the hard timeout issues we experience with native mobile apps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions