LeaseResultDto
Namespace: Meshmakers.Octo.Communication.Contracts.DataTransferObjects
A pool member handing a lease back to the controller (AB#4924, concept Β§4).
public record LeaseResultDto : IEquatable<LeaseResultDto>
Inheritance Object β LeaseResultDto
Implements IEquatable<LeaseResultDto>
Remarks:
π΄ The release is what ends the tenant's presence in the process. By the time this message is sent the member has already left the lease scope, cleared its token holder and unloaded the borrower's CK model. The message is the report, not the trigger β a member that reported a release but kept the tenant loaded would have the invariant backwards.
It carries no secret and no tenant payload, only the identity of the lease and what happened to the work item. The borrower's credential travelled one way, on LeaseDto, and must not come back.
Propertiesβ
LeaseIdβ
The lease being released, as handed out in LeaseDto.LeaseId. A release naming a lease the controller no longer holds is stale and is ignored β it would otherwise release whatever lease the member was given in the meantime.
public string LeaseId { get; set; }
Property Valueβ
Reasonβ
Why the lease ended.
public LeaseReleaseReasonDto Reason { get; set; }
Property Valueβ
Successβ
Whether the work item succeeded. Independent of LeaseResultDto.Reason: a LeaseReleaseReasonDto.Drained release can still carry a completed work item.
public bool Success { get; set; }
Property Valueβ
StatusMessageβ
Free-form human-readable outcome. Must never carry credential material β this string is logged and stored on the execution.
public string StatusMessage { get; set; }
Property Valueβ
OutputDataβ
What SetPipelineExecutionResult@1 wrote for this execution, or null when the pipeline
produced no result (AB#4924 Β§9.9 / D4).
public string OutputData { get; set; }
Property Valueβ
Remarks:
π΄ The release is the only way a leased execution's output can reach its entity. A
dedicated adapter reports it on IAdapterHub.ReportExecutionEndAsync, whose tenant and
adapter come from the connection β a pool member has no such connection, it holds a
tenant-free management channel. Without this field the borrower's execution would complete
with an empty OutputData where a dedicated adapter would have filled it, which is a
difference in behaviour nobody asked for.
This is pipeline output, not credential material β the rule that the lease's credential travels one way only is unchanged.
WorkDurationMsβ
How long the member actually spent running the work item, in milliseconds, or null when it never got that far (AB#4924 increment 9).
public Nullable<long> WorkDurationMs { get; set; }
Property Valueβ
Remarks:
π΄ The controller cannot measure this, and that is why it travels. Concept Β§2.3
keeps the lease-held span and the pipeline-run span deliberately apart because the
difference between them is the per-lease warm-up β token, tenant repository, CK
model, pipeline registration β that a pool exists to amortise. But for a leased execution
the controller is what stamps StartedAt, at claim time, so the entity's own span is
identical to the held span by construction and the difference would read as zero forever.
The member is the only party that knows when the work really began.
Null on a lease that failed before the work item ran, and on a member built before this field existed. The controller records no work or overhead sample in that case rather than a fabricated zero, which would make the pool look infinitely wasteful.
ReleasedAtUtcβ
When the member finished with the tenant (UTC). The controller stamps
LeaseReleasedAt from its own clock rather than this value; it is carried for
diagnostics of clock skew between controller and member.
public DateTime ReleasedAtUtc { get; set; }
Property Valueβ
ExecutionIdβ
The borrower's execution the lease served, as handed out in LeaseDto.ExecutionId, or null on a member built before this field existed (AB#5826).
public string ExecutionId { get; set; }
Property Valueβ
Remarks:
π΄ This is what lets an outcome survive a controller that forgot the lease. Leases live
in the controller's memory. After a controller process restart β or when the member
reconnected to a different controller instance β the controller that receives this release
holds no lease of that id, and with LeaseResultDto.LeaseId alone it could not tell which
execution the outcome belongs to: the result was dropped, the execution stayed
Running and was failed half an hour later by the stuck reaper. With this id (and
LeaseResultDto.TenantId) the controller looks the execution up and applies the outcome, but
only after it has proven from the persisted execution that the work was leased to
LeaseResultDto.MemberId of this pool and is still running β it never trusts the message alone.
TenantIdβ
The borrowing tenant of the lease (LeaseDto.TenantId) β the database LeaseResultDto.ExecutionId lives in. Null on a member built before AB#5826.
public string TenantId { get; set; }
Property Valueβ
MemberIdβ
The member reporting, as accepted at registration. Null on a member built before AB#5826.
public string MemberId { get; set; }
Property Valueβ
Remarks:
Needed because a late release can arrive on a connection that holds no registration yet (the
member reports pending outcomes first and registers afterwards). The controller compares it
with the LeasedOnMemberId stamped on the execution at claim time.
Constructorsβ
LeaseResultDto()β
public LeaseResultDto()