fix(http): harden thread pool lifecycle - #91
Merged
Conversation
- 校验线程池初始化参数并事务式创建、启动工作线程 - 在失败和关闭路径完整回收调度器、事件和线程资源 - 增加优先级分配、初始化回滚与重试生命周期测试 Closes #90 Signed-off-by: Fernandez <yuanhaon81@gmail.com>
11 tasks
Contributor
Author
|
远端 CI 已全部通过: 本地/设备证据和回滚状态见 PR 描述。当前只剩候选绑定确认:
|
Contributor
Author
|
候选绑定验收已收到:
该验收对应 PR 当前 head |
nquyencubas523-cloud
approved these changes
Aug 6, 2026
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.
Summary
Make
HttpServerThreadPoolinitialization transactional, reject invalid lifecycle inputs, preserve active workers on duplicate initialization, and drain accepted work safely during shutdown. Add focused lifecycle/rollback coverage for pool and server initialization.Related issue
Closes #90
Root cause
The pool previously wrote candidate workers directly into live member state, assumed worker indices 0/1/2 existed without enforcing a minimum size, and did not fully guard null/throwing dispatcher factories or duplicate initialization.
Scope
In scope
Out of scope
HttpPost,MsgThread, orutil::Thread.Risk tags
Type of change
Area
Candidate identity
17cdd2e39f8ecc1164db986cd2c8e6f0a10cc3937f6348e46d0bb76fd790c05efdff6e550afac8da8899be440e83fdfa38f100b3090ceb852140c1f9d7021b10edb8f919445725704cd5eb1a8a85dbea3435aea507dae9cab14894859ac2c4e833dc6be26f46147567e1cabc9a7a6b6383ef6416fe06b1b76b06dcd8The candidate was not amended, rebased, merged, or changed after evidence collection.
Verification
Parent baseline
Candidate checks
Risk-based evidence
4f21dfa754d8ac2760579469bc794ee96812aa7fe2592c79f46d5ac07d8bf716; matching Guard SHA-25605ea6d203f1ec536b638d6467ffc61eb44c9bbf0494696482c6d9010f53d7b6d.Real deployment smoke:
active; root page and anonymous Probe returned HTTP 200 through direct and nginx paths with baseline-identical response hashes.MsgHanderThread_0through_3stopped.active,NRestarts=0, started all four handlers, and repeated direct/proxy HTTP 200 responses with no fatal startup log.active,NRestarts=0, baseline hashes and HTTP responses matched, and boot ID was unchanged.Documentation impact
Compatibility and deployment impact
Third-party code and assets
Security and release checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdrequirements were followed.Acceptance and cleanup
验证通过 7f6348e46d0bb76fd790c05efdff6e550afac8da d7021b10edb8f919445725704cd5eb1a8a85dbea3435aea507dae9cab1489485[.network]~[device]+[.device]~[WatchDogService]Notes for reviewers
util::Thread::start()registration behavior on a low-levelstd::threadconstruction exception remains explicitly out of scope. The pool structure still rolls back every worker object it owns.