Conversation
在 shutdown 流程中,队列 worker 可能仍在 drain 消息并尝试写入向量存储, 导致与正在关闭的后端产生锁竞争。提前标记 closing 状态,让 embedding handler 在 shutdown 期间跳过写入操作,避免 LOCK 文件冲突。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
zhoujh01
approved these changes
Feb 28, 2026
MaojiaSheng
reviewed
Feb 28, 2026
| embedding_msg = EmbeddingMsg.from_dict(queue_data) | ||
| inserted_data = embedding_msg.context_data | ||
|
|
||
| if getattr(self._vikingdb, "is_closing", False): |
Collaborator
There was a problem hiding this comment.
这里为什么是通过 getattr 访问属性
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
修复快速重启场景下,队列 worker 仍在 drain 消息并尝试写入向量存储时,与正在关闭的后端产生 LOCK 文件竞争的问题。
Related Issue
N/A
Type of Change
Changes Made
Testing
Checklist
Additional Notes
在 shutdown 流程中,mark_closing() 被提前调用(在停止队列之前),这样队列 worker 在 drain 剩余消息时能感知到关闭状态,主动跳过向量写入操作,避免与 VikingDBManager.close() 产生锁竞争。