refactor: 改进并发安全与代码质量#1726
Open
kasc0206 wants to merge 2 commits into
Open
Conversation
added 2 commits
June 15, 2026 06:40
- 自动修复:行尾空格、多余空行、blockquote/列表/代码块周围空行 - 为无语言的围栏代码块添加语言标识(bash/text/json) - 将粗体标题(**Usage** 等)转换为 Markdown 标题(####) - 对齐表格列格式 - 转换 atx_closed 标题样式 - 创建 .markdownlint.jsonc 配置关闭不适用的规则(行长度、内联 HTML)
- 将 bootstrapLogger 从 nonisolated(unsafe) var 改为 Mutex<Logger?> 保护的计算属性 - 将 APIServer 硬编码端口/地址提取到 NetworkConfig 枚举 - 修复 ContainerRun 中 cidfile 使用 errno C 风格错误处理的问题,改用 throw 式 API - AWS: 改善 Swift 6 并发安全性 - AWS: 提高可配置性和可测试性 - AWS: 统一错误处理风格
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.
修改内容 / Changes
根据代码审查建议(#1727),按优先级实施了以下改进:
Based on the code review recommendations (#1727), the following improvements were implemented by priority:
高优先级:改善 Swift 6 并发安全性 / High Priority: Improve Swift 6 Concurrency Safety
bootstrapLogger从nonisolated(unsafe) var改为Mutex<Logger?>保护的计算属性,消除 unsafe 并发标记Changed
bootstrapLoggerfromnonisolated(unsafe) varto aMutex<Logger?>-protected computed property, eliminating the unsafe concurrency annotation低优先级:代码质量改进 / Low Priority: Code Quality Improvements
NetworkConfig枚举中,提高可配置性Extracted hardcoded addresses and port numbers into a
NetworkConfigenum for better configurabilitycidfile创建从createFile+errno的 C 风格错误处理改为data.write(to:)的 Swift throw 式 APIReplaced C-style error handling (
createFile+errno) with Swift throwing API (data.write(to:)) for cidfile creation验证 / Verification
swift build)相关 Issue / Related Issue
Closes #1727