Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 469c22c843
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return 0; | ||
| } | ||
|
|
||
| // 组件停止在分发停止之前(ADR-0061);超时只记账,不拖住退出。 |
There was a problem hiding this comment.
Restart carrier components when reusing the parent host
On the supported StopUnderParent → StartUnderParent reload path, this new call stops and clears all carrier components, but StartCore returns immediately whenever s_host already exists. Consequently, the next startup reports success without restarting any components; it also skips the configurator and retains services containing the previous native host handle. Reinitialize the carrier lifecycle and handle-dependent services on the reuse path before allowing the parent to deliver plugins.
Useful? React with 👍 / 👎.
| if (!s_host.StartComponents(carrierDirectory, startup.Components)) | ||
| { | ||
| logger.LogError("{Message}", CoreText.Get("Native_ComponentsFailed", string.Join(" | ", startup.Components))); | ||
| return 1; |
There was a problem hiding this comment.
Clear the published host after component startup fails
If a declared component cannot load or throws during startup, this branch returns failure after s_host has already been assigned. StartComponents rolls back the components, but the static host remains published, so a subsequent startup returns success through the existing-host shortcut without retrying components or, in self-hosted mode, reaching LoadAll. Keep the host local until startup succeeds, or clear and clean it up on failure, so a retry cannot mistake an aborted startup for a running core.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 073da31c78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var restarted = CarrierStartup.Create( | ||
| args.CarrierDirectory, args.Host, s_loggerFactory!, out var restartError); |
There was a problem hiding this comment.
Catch startup exceptions on the reused-host path
During a parent reload, this branch executes outside the try/catch protecting initial startup. CarrierStartup.Create can still throw—for example, when a configurator registers an invalid open-generic service and BuildServiceProvider() rejects it after TryConfigure returns. Such a failure escapes StartUnderParent through its [UnmanagedCallersOnly] boundary instead of returning a startup error, potentially terminating the server. Put the reuse path under the same exception boundary as initial startup.
Useful? React with 👍 / 👎.
| return 1; | ||
| } | ||
|
|
||
| reused.RepublishCarrierServices(restarted.Services); |
There was a problem hiding this comment.
Dispose the previous carrier container when replacing it
On each parent reload, a newly built service provider replaces the previous one, but neither StopCore nor RepublishCarrierServices disposes the old provider. If the configurator registers disposable singleton services that components or plugins resolve, their cleanup never runs; services owning timers or other persistent resources can consequently remain active across successive reloads. Track ownership of these internally created providers and dispose the previous generation after its consumers have stopped, before discarding it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 073da31c78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| reused.RepublishCarrierServices(restarted.Services); | ||
| if (restarted.Directory is { Length: > 0 } reusedDirectory && restarted.Components.Count > 0) | ||
| { | ||
| if (!reused.StartComponents(reusedDirectory, restarted.Components)) |
There was a problem hiding this comment.
Contain exceptions on the reused-host startup path
On a StopUnderParent → StartUnderParent reload, this branch executes outside the try/catch that protects initial startup. For example, if the carrier manifest contains "components": [null], CarrierStartup.Create succeeds, but StartComponents throws when accessing component.Assembly. That exception escapes the [UnmanagedCallersOnly] entry point and can terminate the server instead of returning a startup failure. Put the reuse initialization and component startup inside the same exception boundary as initial startup.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fce11f2c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (previous is IDisposable disposable && !ReferenceEquals(previous, services)) | ||
| { | ||
| disposable.Dispose(); |
There was a problem hiding this comment.
Support asynchronous disposal of carrier services
If a carrier configurator registers a singleton that implements only IAsyncDisposable and a component or plugin resolves it, the built-in DI provider's synchronous Dispose() throws rather than disposing that service. On the next parent reload, this exception propagates from RepublishCarrierServices into the startup error handler, so startup fails before restarting any components and the old service remains uncleaned. Dispose internally built providers through their asynchronous disposal path when supported, and await completion before continuing startup.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ADR-0061 / 0064 / 0065 的核心半边。
CarrierStartup:读载体清单 → 并共享层 → 建容器 → 跑carrier.bootstrap→ 交IServiceProvider。NativeHostingEntry宿主契约 2:Start/StartUnderParent参数为{ const char* carrierDirectory; void* host; },nullptr等价旧行为;启动链在装载插件之前StartComponents,失败中止启动;StopCore先StopComponents。合并顺序:契约 → 核心 → HostingShim → 文档。