Skip to content

Close stdin after writing to prevent LFS smudge hang#123

Open
grub-basket wants to merge 1 commit into
jorio:masterfrom
grub-basket:fix/lfs-smudge-stdin-hang
Open

Close stdin after writing to prevent LFS smudge hang#123
grub-basket wants to merge 1 commit into
jorio:masterfrom
grub-basket:fix/lfs-smudge-stdin-hang

Conversation

@grub-basket

Copy link
Copy Markdown

Problem

RepoTask.flowStartProcess writes to the child process's stdin but never closes the write channel:

if stdin:
    process.write(stdin.encode("utf-8"))

DownloadLfsObjects pipes an LFS pointer into git lfs smudge, which reads stdin until EOF. With the write channel left open, smudge blocks 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).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant