Close stdin after writing to prevent LFS smudge hang - #123
Conversation
flowStartProcess wrote to the child's stdin but never closed the write channel. DownloadLfsObjects pipes an LFS pointer into 'git lfs smudge', which reads stdin until EOF; without closeWriteChannel() the process blocks forever and the task never finishes, leaving the UI busy. Close the write channel after writing stdin.
|
My understanding is I think your fix can still prevent In this case, fortunately our UI stays responsive and allows killing the underlying process if it takes too long. But having |
|
You're right, and my "blocks forever" wording was too absolute — sorry about that. For a well-formed pointer, Where |
Problem
RepoTask.flowStartProcesswrites to the child process's stdin but never closes the write channel:DownloadLfsObjectspipes an LFS pointer intogit lfs smudge, which reads stdin until EOF. With the write channel left open,smudgeblocks forever waiting for EOF, the task never finishes, and the UI stays busy.Repro
Open a diff of an LFS-tracked file whose object isn't cached locally → the smudge task hangs indefinitely.
Fix
Call
process.closeWriteChannel()after writing stdin, so children that read to EOF terminate normally.Prepared with Claude Fable 5 (Low effort mode).