fix(seed): wait for L2/L3 before closing pipeline - #645
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Expose a full pipeline flush barrier that waits for L1, then L2, then the L3 work enqueued by L2. Cancel recurring L2 timers after a finite batch drain so destroy does not trigger a duplicate extraction pass. Use the barrier at the end of seed imports to ensure scene and persona artifacts are persisted before storage closes. Add a regression test that holds L2 and L3 independently and proves flushAll does not resolve early. Refs TencentCloud#115 Signed-off-by: RerankerGuo <121015044+RerankerGuo@users.noreply.github.com>
6 tasks
Collaborator
|
Thank you for your interest and contributions! We will review your code and get back to you as soon as possible! |
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.
Description | 描述
Fix the remaining seed lifecycle defect from #115: the seed runtime previously waited only for L1 to become idle, then called the gateway-oriented
destroy()path. That path has an intentional 2-second shutdown budget and marks the scheduler destroyed before flushing, so a scheduled/running L2 extraction or the L3 persona task triggered by L2 could be skipped or interrupted before artifacts reached disk.This PR adds a finite-batch completion barrier:
MemoryPipelineManager.flushAll()to drain pending L1 work, flush scheduled L2 work, then wait for L3.destroy()call from triggering a duplicate L2 pass.flushAll()so scene and persona artifacts are complete before storage resources close.Scope boundary: this does not change the JSON correction/retry behavior already covered by #190, or the seed tail-batch flush behavior covered by #507.
Related Issue | 关联 Issue
Refs #115
Change Type | 修改类型
Self-test Checklist | 自测清单
Additional Notes | 其他说明
Validation (Node v26.5.0, npm v11.17.0):
No configuration, storage schema, or public HTTP API changes.