Investigate race condition in ql command availability - pending resolution#2893
Investigate race condition in ql command availability - pending resolution#2893
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
|
@copilot linkCommandToDir 不是处理了吗 |
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
You're right! I found that The symlinks are created automatically by the backend's |
那实际上为什么 ql 命令 |
实际上存在时序问题: docker-entrypoint.sh 在第 45、50 行使用
所以用户会遇到 "ql: command not found"。 需要在 docker-entrypoint.sh 中提前创建软链接,或者等待后端启动完成。我应该恢复之前的修改吗? |
This PR initially reverted proposed changes after discovering that the backend already handles symlink creation for the
qlcommand. However, further investigation revealed a race condition that causes the reported issue.Investigation
The
qlcommand referenced indocker-entrypoint.sh(lines 45, 50) is created by the backend code inback/loaders/deps.ts, but there's a timing issue:The
linkCommandToDir()function in the backend:$HOME/bindirectoryshell/update.sh→$HOME/bin/qlshell/task.sh→$HOME/bin/taskThis function is called automatically when the Node.js application starts via
linkDeps()inback/loaders/app.ts.Race Condition Identified
The docker-entrypoint.sh script has a race condition:
reload_pm2starts the Node.js backend asynchronously in the backgroundqlcommand without waiting for backend initializationlinkCommandToDir()function hasn't run yet, so symlinks don't existThe entrypoint script attempts to use the
qlcommand before the backend has created the necessary symlinks, causing the user-reported issue.Changes Made
docker/docker-entrypoint.sh: Removed initially proposed symlink creation codeshell/ql.sh: Deleted initially proposed wrapper scriptRoot Cause Analysis
The original issue ("ql: command not found") reported by users is caused by a timing/race condition:
qlcommands before the backend has finished initializing and creating the symlinksStatus
Awaiting maintainer decision on resolution approach:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.