fix(platform): 修复生命周期终态与任务清理#715
Open
zhibeigg wants to merge 1 commit into
Open
Conversation
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
原有问题
平台生命周期和执行器缺少明确的终态,异步启动、关闭与任务句柄绑定之间可能发生倒退或遗漏清理:
ACTIVE,关闭期间仍可能收到迟到的启用回调,生命周期从 DISABLE 倒退到 ENABLE/ACTIVE。典型触发场景与后果
本 PR 修改
ACTIVE生命周期,并以单向终态状态机阻止关闭期间发生生命周期倒退;停止标记下仍允许执行 DISABLE 清理。EventTask串联异步关闭,保留旧同步入口,并为自定义事件增加callAsync()以暴露完成和异常状态。PluginCommand身份清理 Bukkit 主名、别名、namespace 及内部绑定,同名重注册前移除旧映射。修改目的
让所有平台生命周期只向前推进,并确保插件停止后不再产生新任务或残留注册;异步事件和关闭流程的异常必须能够被调用方观察。
兼容性与行为变化
验证
./gradlew :common:test :platform:platform-application:test :platform:platform-bukkit-impl:test :platform:platform-velocity:test :platform:platform-velocity-impl:test :platform:platform-afybroker:test --rerun-tasks --no-parallel./gradlew :common:build :platform:platform-application:build :platform:platform-bukkit-impl:build :platform:platform-velocity:build :platform:platform-velocity-impl:build :platform:platform-afybroker:build --no-parallelgit diff --check upstream/dev/6.3.0...HEADRefs #703