Skip to content

fix: add structured runtime configuration update results - #667

Merged
SunSi12138 merged 13 commits into
devfrom
fix/654-structured-runtime-config-result
Sep 12, 2026
Merged

SunSi12138 merged 13 commits into
devfrom
fix/654-structured-runtime-config-result

Conversation

@SunSi12138

@SunSi12138 SunSi12138 commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add SharpLinkRuntimeConfigurationUpdateResult with machine-readable failure codes for expected runtime-control rejection
  • add non-throwing Try... runtime configuration paths across built-in Client and Server controls while keeping existing throwing APIs compatible
  • preserve validation/cancellation/invariant exceptions and existing generation/capture semantics
  • return UnsupportedByImplementation for custom Client/Server implementations that do not expose the built-in structured capability
  • document the result-vs-exception contract in doc/control-plane-results.md

Acceptance coverage

  • lifecycle/Stop rejection is structured and does not publish a new generation/state
  • Client lifecycle rejection uses canonical LifecycleState + stop seal; transient connectivity State.Faulted while lifecycle is Running still accepts runtime publication
  • endpoint-admission vs circuit-breaker conflict returns ModeConflict
  • invalid arguments remain argument exceptions and publish nothing
  • successful timeout update preserves logical-call capture boundaries
  • Server admission update racing Stop returns LifecycleClosed and never publishes the prepared candidate
  • Client and Server RPC-session flush policy now expose TryUpdateRpcSessionFlushPolicy; success publishes atomically, Stop returns LifecycleClosed, and custom implementations return UnsupportedByImplementation
  • custom ISharpLinkClient / ISharpLinkServer implementations receive an explicit non-throwing unsupported result
  • [Runtime Architecture][Phase 18] 完成 public API/package 审计、发布门禁与迁移文档 #86 records the public API/migration path for callers moving from expected InvalidOperationException handling to the structured Try... contract

Validation

Final head 9b274943 is synced with dev (behind 0). All GitHub Actions workflows passed:

  • PR Quick — formatting, maintainability gates, Debug/Release builds, unit/generator/load tests, integration tests, NativeAOT smoke, pack/NuGet contract and smoke, demo/load/chaos smoke
  • PR Fast — Release build, reference boundary guard, unit/generator/load tests, allocation gate
  • RPC Session Flush Performance Evidence — same-machine base/head benchmark evidence passed
  • CodeQL
  • Pending and codec validation
  • Extension fault containment

Review regressions include the deterministic LifecycleState == Running / State == Faulted connectivity window and Client/Server RPC-session flush success, lifecycle rejection, invalid-input, unsupported-implementation, and unchanged-generation cases.

Closes #654

@SunSi12138
SunSi12138 marked this pull request as ready for review September 12, 2026 06:04

@SunSi12138 SunSi12138 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整体 structured-result 方向与 #654 对齐,Server publication/stop seal、custom implementation fallback、参数/回调异常边界目前没有发现新的阻塞问题。这里有 1 个 Client 状态域 blocker:新的稳定 LifecycleClosed contract 仍把 legacy connectivity State.Faulted 当作 local lifecycle closure。

@SunSi12138 SunSi12138 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充 1 个 coverage blocker:#667 声明为 built-in Client/Server runtime controls 提供 structured Try... path,但现有 Client/Server UpdateRpcSessionFlushPolicy(...) 完全遗漏。两边当前都把 Stop/Draining/Faulted 作为 InvalidOperationException,custom implementation 也以 NotSupportedException 表达 unsupported,正属于 #654 要结果化的 expected runtime publication rejection。请为 Client 和 Server 的 RPC-session flush policy 补对应 non-throwing Try...(参数验证仍 exceptional、Stop/lifecycle closed 返回 LifecycleClosed、custom implementation 返回 UnsupportedByImplementation),并加 success + stopped/unsupported regression;Client 侧同时要遵守另一条 review 提到的 canonical lifecycle 状态域,不能把 transient connectivity State.Faulted 当 lifecycle closed。

Copy link
Copy Markdown
Owner Author

已处理本轮剩余 coverage blocker,修复 commit 为 9b274943:

  • Client/Server UpdateRpcSessionFlushPolicy(...) 现在都有 canonical TryUpdateRpcSessionFlushPolicy(...) structured path;valid candidate 原子发布,Stop/lifecycle seal 返回 LifecycleClosed,custom implementation 返回 UnsupportedByImplementation,非法参数仍保持 argument exception。
  • Client lifecycle 判定改为 _stopStarted + canonical LifecycleState,不再把 transient connectivity State.Faulted 误判为 lifecycle closure。
  • 新增回归覆盖:Client/Server flush success、Stop rejection、generation 不变、invalid input、custom unsupported,以及真实 LifecycleState=Running / State=Faulted 窗口下 request-timeout publication 成功。
  • 新 head 9b274943 相对 dev 为 behind 0;PR Quick、PR Fast、CodeQL、Pending/codec、Extension fault containment、RPC Session Flush Performance Evidence 共 6 条 workflow 全绿。

@SunSi12138 SunSi12138 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审通过。两条 blocker 均已在 exact head 9b274943d95a6ec27712ecba6b72e6663c7f0b21 收敛:Client structured runtime publication 改用 _stopStarted + canonical LifecycleState,并以确定性 Running / State.Faulted / NotReady 回归证明 transient connectivity fault 不会误报 LifecycleClosed;Client/Server RPC-session flush 已补 TryUpdateRpcSessionFlushPolicy,覆盖成功原子 publication、invalid input、Stop 后 generation 不变以及 custom implementation UnsupportedByImplementation。当前 dev 仍是 PR merge base,behind_by=0;exact-head Quick/Fast/CodeQL/Pending+codec/Extension containment/RPC Session Flush Performance Evidence 全绿。未发现新的实质 blocker。

@SunSi12138
SunSi12138 merged commit 3af94ea into dev Sep 12, 2026
8 checks passed
@SunSi12138
SunSi12138 deleted the fix/654-structured-runtime-config-result branch September 12, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant