microsoft / microsoft/vscode-remote-release
Rebuilding/restarting devcontainer results in stale sockets and other items left all over the place, which leads to problems
@chrmarti is already working on this.
Since Feb 22, 2022.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
#5955 was closed, and https://github.com/microsoft/vscode-remote-release/issues/5955#issuecomment-990136815 seems to indicate that VS Code leaving around old state is as designed, but this remains problematic.
After restarting/rebuilding my container several times, I have multiple entries inside my container for:
# inside container
/tmp/vscode-git-*.sock
/tmp/vscode-ipc-*.sock
/tmp/vscode-remote-containers-*.js
/tmp/vscode-remote-containers-ipc-*.sock
/tmp/vscode-remote-containers-server-*.js
/tmp/vscode-ssh-auth-*.sock
~/.vscode-server/bin/*
Tenancy and hygiene annoyances aside, this is actually quite frustrating. I don't find VS Code's embedded terminal emulator very useful and would rather use my own. When I do, I docker exec my own shell in the container and run tmux and other command line tooling. When I do that I rely on there being one, unambiguous entry in each of those locations to automate setup¹ of things like:
export VSCODE_IPC_HOOK_CLI="$( \ls 2>/dev/null -1 -t /tmp/vscode-ipc-*.sock | head -n 1 )" # needed to be able to open files in VS Code's editor from the command line
export SSH_AUTH_SOCK="$( \ls 2>/dev/null -1 -t /tmp/vscode-ssh-auth-*.sock | head -n 1 )"
export PATH="${PATH}${PATH:+:}$( \ls 2>/dev/null -1 -t "${HOME}/.vscode-server/bin" | head -n 1 )"
This breaks when VS Code leaves its rabbit droppings of old, unused sockets and files around. Further, it makes it hard to determine which of those is usable.
On the host, it's even worse:
% # on host
% \ls "${TMPDIR}"/vscode-remote-* | wc -l
52
% \ls "${TMPDIR}"/vscode-git-* | wc -l
10
Why do I need 62 sockets on my host for one running container?
- VSCode Version: 1.64.1
- Local OS Version: OS X 11.6.3
- Remote OS Version: oraclelinux:8
- Remote Extension/Connection Type: Docker
¹ Please don't tell me to copy/paste from VS Code's terminal every time I create an external session. That's not a solution and it's not helpful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.