[Core] Make post-load publication warm-only
Close publication leases inside Host Weight Runtime, return only the publication report, and cover the new terminal mappings. Rename the runtime test module to avoid the pytest basename collision reported in #6436. Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
4c773109b1
commit
339761045f
6 files changed
+185
-69
No files matched your search
@@ -146,26 +146,8 @@ class PostLoadPublicationReport:
|
||||
raise ValueError("post-load publication failure ownership is inconsistent")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class HostWeightPublication:
|
||||
"""Separate post-load outcome whose successful lease belongs to the caller."""
|
||||
|
||||
report: PostLoadPublicationReport
|
||||
lease: HostWeightLease | None = None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
lease_outcomes = {
|
||||
PostLoadPublicationOutcome.ALREADY_PRESENT,
|
||||
PostLoadPublicationOutcome.PUBLISHED,
|
||||
PostLoadPublicationOutcome.JOINED,
|
||||
}
|
||||
if (self.report.outcome in lease_outcomes) != (self.lease is not None):
|
||||
raise ValueError("post-load publication outcome has inconsistent lease ownership")
|
||||
|
||||
|
||||
__all__ = [
|
||||
"AttemptResult",
|
||||
"HostWeightPublication",
|
||||
"HostWeightResolution",
|
||||
"PostLoadPublicationOutcome",
|
||||
"PostLoadPublicationReport",
|
||||
|
||||
Reference in new issue
Block a user