DoorHost

The door host: it holds the one door of this user and host, runs each call as one OPAL plan, and owns the stores of the parts (trove-parts §TPA-5, §TPD-4 to §TPD-10).

Inherits QObject and octomy::localdoor::ICallHandler
Group libtrove

In the namespace octomy::trove::door. Declared in src/libs/libtrove/trove/door/DoorHost.hpp.

Detailed description

One writer

All state of the parts for one identity has one writer process: the door host that holds the door lock. No lock guards an app's base folder, so the lock of the door decides. A HUB that does not hold it runs no part.

A call is a plan on a runtime of its own

The spec door of before ran each call on the active runtime, which runs one plan at a time, answered a second call with 503, and answered a call with the result of whichever plan completed first (§TPD-12 defects 2 and 6). Here each call is one plan on the host's own runtime, which has an OpalResourceManager. Calls whose tasks use different resource scopes run at once, calls on one scope run in order, and the host answers a call only with the plan that has the call's session id. A call that waits more than kBusyWaitMs for its scope answers 503 with the scope.

The runtime follows the active runtime's auth context, LLM manager and history database at each call, so a precondition, an `llm.*` task and the history see what a call from the window sees.

Before the plan

The host refuses fast and by name, instead of letting the runtime wait 60 seconds for an answer from nobody:

- `404` when no task has the name. - `409 {"confirm": task}` when the task confirms every call and no operator can answer: a standalone host, or a HUB with no window (§TPD-10). - `403 {"scope": …}` when a scope of the task has no grant.

A call that runs on another node

A forwarder (setForwarder()) sees each call first. DoorRemoteSessions sends a `spec.*` call from the folder of a remote session to the node that opened the session, and that node checks and runs it (trove-parts §TPL-5).

Handover

handOver() stops new calls, lets the running ones end, closes the stores and the door, and emits handedOver(). The leases live in the stores, so they survive.

See also octomy::localdoor::DoorServer, octomy::trove::specdb::SpecService.

In this section