fix(ostool): avoid re-polling completed serial tasks - #191
Merged
Merged
Conversation
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.
问题
串口 WebSocket 关闭时,如果写入任务已经完成、读取任务仍然挂起,超时清理会再次等待已经完成的写入
JoinHandle,触发 Tokio 的JoinHandle polled after completionpanic。发生在板卡会话清理阶段时,该 panic 会使原本的测试结果被清理错误覆盖。改动
JoinHandle所有权;仅在等待确实完成后清空对应槽位。超时取消等待期间,尚未完成的句柄仍留在槽位中,供清理分支终止并回收。abort并等待仍在槽位中的任务,避免重复轮询已完成句柄,同时保留原先先等待两个任务、再处理任务错误的行为。验证
JoinHandle polled after completion;修改后两个定向用例均通过。cargo fmt --all -- --checkcargo clippy --target x86_64-unknown-linux-gnu --all-featurescargo build --target x86_64-unknown-linux-gnu --all-featurescargo test -p ostoolcargo test --target x86_64-unknown-linux-gnu -- --nocapture本次未改变发布版本或变更日志,也未宣称已复现实体板卡故障;回归覆盖的是该故障日志所示的清理 panic。