Repository navigation
feat: 增加卸载超时、加载器诊断与插件状态快照 - #1
Conversation
Codex Review SummaryThis 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: 68718c739a
ℹ️ 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".
| slot.State, | ||
| slot.Enabled, | ||
| slot.IsLoader, |
There was a problem hiding this comment.
Clear Enabled when detaching a plugin
When an enabled plugin's unload verification fails or times out, the slot remains visible as Detached, but Detach never clears slot.Enabled; consequently this new snapshot reports Enabled = true even though the scope is closed and the plugin instance has been unloaded. Consumers polling Plugins or TryGetPlugin therefore receive a contradictory state and may treat a non-running plugin as enabled.
Useful? React with 👍 / 👎.
| if (options.UnloadVerificationTimeout <= TimeSpan.Zero | ||
| && options.UnloadVerificationTimeout != Timeout.InfiniteTimeSpan) |
There was a problem hiding this comment.
Reject timeout values unsupported by WaitAsync
For a positive timeout above the timer-supported range (approximately 49.7 days), this validation accepts the option, but Task.WaitAsync(TimeSpan) throws ArgumentOutOfRangeException. UnloadCore then catches it as a verification failure, clears the verification task, and every unload retry fails without performing verification. Either reject such values during construction or handle long finite budgets without passing them directly to WaitAsync.
Useful? React with 👍 / 👎.
改动
PluginManagerOptions.UnloadVerificationTimeout:默认 30 秒,超时返回失败,插件留在待回收,下一次卸载复用同一个验证任务。IPluginLoaderDiagnostics:在CanLoad之后、Load之前收集问题并并入加载报告。PluginState、PluginInfo、Plugins、TryGetPlugin,不暴露PluginHandle或内部槽位。验证