Documentation
¶
Overview ¶
Package executor runs guest programs for one dispatcher control session at a time.
A node holds what must survive a reconnect: the packet counter, the TESLA key schedule and this executor's configured identity. It reserves one session at a time, so a successor exists only after the previous session's cleanup has joined. A session owns what belongs to one control binding: the executor state, the control transport and the scheduler loop.
The transport decides whether a binding still holds authority. A binding is armed while its lease is valid; admission and each step of execution recheck it, and the scheduler's insert and start commits are guarded by it, because an Allocate reply, a compilation or a STARTED acknowledgement can return after the authority that ordered it has expired. Work keeps the binding it was admitted under: after a reconnect the successor quarantines the rows of the session it replaced instead of running them, and it neither delivers nor releases the terminal results that session retained.
Stopping a session cancels running work and starts both cleanup domains, the scheduler's and the transport's, before joining either. A bounded Wait that expires abandons neither: the local outcome stays unknown, the node reservation is kept, and nothing may be deleted, upgraded or closed on the strength of it. What storage still holds afterwards is that executor's disposition: accepted queued rows stay persisted and are never replayed, and a terminal result whose delivery was not acknowledged stays retained for a later reconciliation pass under its own binding.
Index ¶
- Variables
- type Executor
- func (e *Executor) Listen(parent context.Context) error
- func (e *Executor) OnAbort(ctx context.Context, binding controlsession.Binding, req *pb.AbortRequest) (*pb.AbortResponse, error)
- func (e *Executor) OnBandwidth(ctx context.Context, binding controlsession.Binding, req *pb.BandwidthRequest) (*pb.BandwidthResponse, error)
- func (e *Executor) OnDebugletFailed(ctx context.Context, spec scheduler.Spec, err error) scheduler.Completion
- func (e *Executor) OnDebugletStart(ctx context.Context, spec scheduler.Spec) scheduler.Completion
- func (e *Executor) OnHello(ctx context.Context, req *pb.HelloRequest) (*pb.HelloResponse, error)
- func (e *Executor) OnInspectRetainedRun(ctx context.Context, binding controlsession.Binding, ...) (*pb.InspectRetainedRunResponse, error)
- func (e *Executor) OnUpload(ctx context.Context, binding controlsession.Binding, req *pb.UploadRequest) (_ *pb.UploadResponse, uploadErr error)
- func (e *Executor) OnVerifyTags(ctx context.Context, binding controlsession.Binding, req *pb.VerifyTagsRequest) (*pb.VerifyTagsResponse, error)
- func (e *Executor) WaitResourcesReady(ctx context.Context) error
- type Node
- type RunningDebuglet
- type Session
Constants ¶
This section is empty.
Variables ¶
var ( ErrNodeClosed = errors.New("executor node is closed") ErrNodeBusy = errors.New("executor node has an unjoined session") )
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
Bidi *rpc.BidiClient
// contains filtered or unexported fields
}
func (*Executor) OnAbort ¶
func (e *Executor) OnAbort(ctx context.Context, binding controlsession.Binding, req *pb.AbortRequest) (*pb.AbortResponse, error)
func (*Executor) OnBandwidth ¶
func (e *Executor) OnBandwidth(ctx context.Context, binding controlsession.Binding, req *pb.BandwidthRequest) (*pb.BandwidthResponse, error)
func (*Executor) OnDebugletFailed ¶
func (*Executor) OnDebugletStart ¶
func (*Executor) OnHello ¶
func (e *Executor) OnHello(ctx context.Context, req *pb.HelloRequest) (*pb.HelloResponse, error)
func (*Executor) OnInspectRetainedRun ¶
func (e *Executor) OnInspectRetainedRun(ctx context.Context, binding controlsession.Binding, req *pb.InspectRetainedRunRequest) (*pb.InspectRetainedRunResponse, error)
OnInspectRetainedRun reads one stored run under the caller's exact session. It schedules, starts, finalizes, deletes and pays for nothing, and it never loads the stored program. A read failure or an unsupported backend is an error, never a successful missing-row answer.
func (*Executor) OnUpload ¶
func (e *Executor) OnUpload(ctx context.Context, binding controlsession.Binding, req *pb.UploadRequest) (_ *pb.UploadResponse, uploadErr error)
func (*Executor) OnVerifyTags ¶ added in v0.3.0
func (e *Executor) OnVerifyTags(ctx context.Context, binding controlsession.Binding, req *pb.VerifyTagsRequest) (*pb.VerifyTagsResponse, error)
OnVerifyTags answers whether exactly one candidate run reproduces the tag of every packet of one group, under a key this executor has not disclosed yet. The answer is one verdict for the whole group: it never carries tags, keys or per-packet results, and neither does the log. Duplicate candidate IDs are malformed, so ambiguous means two distinct runs reproduce every tag.
func (*Executor) WaitResourcesReady ¶
WaitResourcesReady waits for the first successful positive-capacity Resources acknowledgement, or the terminal startup error. Discovery heartbeat readiness is deliberately a separate dispatcher state.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node retains the resource identity which must survive network reconnects. Its one session reservation is lifecycle ownership, never lease authority.
type RunningDebuglet ¶
type RunningDebuglet struct {
// contains filtered or unexported fields
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session owns local completion. Binding, deadlines and first loss cause exist only in executor.Bidi; this type never reconstructs lease authority.
func NewSession ¶
NewSession returns a session only once its scheduler guards and the one lease controller they commit under are wired. Its restore policy accepts no stored binding, so every row an earlier session left is quarantined.
func (*Session) Run ¶
Run reports why this session ended; Wait separately reports whether all local work joined cleanly. Restore precedes all network and fresh queue execution.
func (*Session) Stop ¶
Stop revokes the transport's eligibility at once and cancels running work, then starts both owned cleanup domains; cleanup joins them.
func (*Session) Wait ¶
Wait bounds only the caller's join. A timeout never abandons the cleanup that is running, releases the node reservation, or permits database closure underneath SQL.
A nil error is the join itself: local ownership finished and the retained state is nobody's any more. Any other outcome, an expired bound included, leaves the local outcome unknown, and nothing may be deleted, upgraded or closed on the strength of it. Either way what storage holds is this package's ordinary disposition of stopped work.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cleanup is the one place executor components classify resource release failures.
|
Package cleanup is the one place executor components classify resource release failures. |
|
netpolicy
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports.
|
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports. |
|
wasm
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime.
|
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime. |
|
Package isolation owns the executor's local compiler and guest processes.
|
Package isolation owns the executor's local compiler and guest processes. |
|
Package outputstore persists output independently of execution scheduling.
|
Package outputstore persists output independently of execution scheduling. |
|
destinations
Package destinations holds the bookkeeping both packet counters keep to apply a per-destination limit given by name: which resolved addresses each debuglet's connections to that name reached.
|
Package destinations holds the bookkeeping both packet counters keep to apply a per-destination limit given by name: which resolved addresses each debuglet's connections to that name reached. |
|
memory
Package memory is the in-memory admission core both executor schedulers use.
|
Package memory is the in-memory admission core both executor schedulers use. |
|
sqlite
Package sqlite keeps one executor's persisted work and terminal results across restarts without silently running stored work again.
|
Package sqlite keeps one executor's persisted work and terminal results across restarts without silently running stored work again. |
|
Package tagger provides a transparent IPv4 IPID tagger that injects a 16-bit TESLA-derived authentication tag into every outgoing IPv4 packet.
|
Package tagger provides a transparent IPv4 IPID tagger that injects a 16-bit TESLA-derived authentication tag into every outgoing IPv4 packet. |
|
ebpf
Package ebpf provides an eBPF-based IPv4 IPID tagger for Linux.
|
Package ebpf provides an eBPF-based IPv4 IPID tagger for Linux. |
|
tagvectors
Package tagvectors loads testdata/tag-vectors-v1.json, the known-answer vectors of the debuglet-tag-v1 packet tag generated by the independent Python reference tools/tag_vectors.py.
|
Package tagvectors loads testdata/tag-vectors-v1.json, the known-answer vectors of the debuglet-tag-v1 packet tag generated by the independent Python reference tools/tag_vectors.py. |
|
tesla
Package tesla implements a TESLA-inspired hash-chain key schedule for delayed disclosure of packet authentication keys.
|
Package tesla implements a TESLA-inspired hash-chain key schedule for delayed disclosure of packet authentication keys. |
|
transport
|
|