feat(worker,gateway): report record-info pin outcome in WorkerReady; drain-thread completion tests

The worker logged its MXSTATUS_PROXY record-info pin outcome only to its own
stderr, which the gateway's launcher does not capture, so operators never saw
whether the pin took.

- Contract (additive, internal IPC): WorkerReady.record_info_pin_status = 5.
  No protocol version bump; an older peer ignores it or sends it empty.
  Regenerated Contracts/Generated, the client protoset, the Rust vendored
  proto, and the Go/Python/Java worker bindings (real delta only).
- Worker: the handshake copies MxStatusProxyRecordInfoPin.Status into
  WorkerReady unless the runtime already set it.
- Gateway: WorkerClient records it (IWorkerClient.RecordInfoPinStatus, default
  null) and logs it at Information when pinned, Warning otherwise; empty is
  not logged. Shown as "Record-info pin" in the dashboard session details
  Worker table via DashboardSessionSummary.WorkerRecordInfoPinStatus.
- Tests: drain-thread cancellation (task ends Canceled; RunAsync cancels,
  runtime disposed, thread exits, no EventDrain stop-failure log) and fault
  (exception on the thread faults RunAsync with the same instance) paths;
  WorkerReady carries the pin status; gateway logging/recording and the
  dashboard projection.
- Docs: gateway.md STA thread model (drain thread, pin step in COM lifetime),
  MxAccessWorkerInstanceDesign, GatewayProcessDesign, GatewayDashboardDesign,
  WorkerFrameProtocol.
This commit is contained in:
Joseph Doherty
2026-11-21 08:11:31 -05:00
parent 659bb831a2
commit 30ac3f3225
23 changed files with 878 additions and 145 deletions
@@ -580,8 +580,15 @@ type WorkerReady struct {
MxaccessProgid string `protobuf:"bytes,2,opt,name=mxaccess_progid,json=mxaccessProgid,proto3" json:"mxaccess_progid,omitempty"`
MxaccessClsid string `protobuf:"bytes,3,opt,name=mxaccess_clsid,json=mxaccessClsid,proto3" json:"mxaccess_clsid,omitempty"`
ReadyTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=ready_timestamp,json=readyTimestamp,proto3" json:"ready_timestamp,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
// Outcome of the worker's process-wide MXSTATUS_PROXY record-info pin
// (MxStatusProxyRecordInfoPin): "pinned {library-guid} vM.m record {record-guid}" on
// success, or the failing call and HRESULT / exception type otherwise. Empty when the
// worker made no attempt (an older worker, or a runtime that never created the
// MXAccess COM object). Diagnostic only: the gateway logs it and shows it on the
// dashboard, and never gates readiness on it, because the pin is a cache warm-up.
RecordInfoPinStatus string `protobuf:"bytes,5,opt,name=record_info_pin_status,json=recordInfoPinStatus,proto3" json:"record_info_pin_status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WorkerReady) Reset() {
@@ -642,6 +649,13 @@ func (x *WorkerReady) GetReadyTimestamp() *timestamppb.Timestamp {
return nil
}
func (x *WorkerReady) GetRecordInfoPinStatus() string {
if x != nil {
return x.RecordInfoPinStatus
}
return ""
}
type WorkerCommand struct {
state protoimpl.MessageState `protogen:"open.v1"`
Command *MxCommand `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
@@ -1139,12 +1153,13 @@ const file_mxaccess_worker_proto_rawDesc = "" +
"\x10protocol_version\x18\x01 \x01(\rR\x0fprotocolVersion\x12\x14\n" +
"\x05nonce\x18\x02 \x01(\tR\x05nonce\x12*\n" +
"\x11worker_process_id\x18\x03 \x01(\x05R\x0fworkerProcessId\x12%\n" +
"\x0eworker_version\x18\x04 \x01(\tR\rworkerVersion\"\xce\x01\n" +
"\x0eworker_version\x18\x04 \x01(\tR\rworkerVersion\"\x83\x02\n" +
"\vWorkerReady\x12*\n" +
"\x11worker_process_id\x18\x01 \x01(\x05R\x0fworkerProcessId\x12'\n" +
"\x0fmxaccess_progid\x18\x02 \x01(\tR\x0emxaccessProgid\x12%\n" +
"\x0emxaccess_clsid\x18\x03 \x01(\tR\rmxaccessClsid\x12C\n" +
"\x0fready_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x0ereadyTimestamp\"\x92\x01\n" +
"\x0fready_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x0ereadyTimestamp\x123\n" +
"\x16record_info_pin_status\x18\x05 \x01(\tR\x13recordInfoPinStatus\"\x92\x01\n" +
"\rWorkerCommand\x128\n" +
"\acommand\x18\x01 \x01(\v2\x1e.mxaccess_gateway.v1.MxCommandR\acommand\x12G\n" +
"\x11enqueue_timestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x10enqueueTimestamp\"\x9c\x01\n" +