[supervisor] Show process that serves port
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 1.4k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 5
Description
At the moment we scan /proc/net/tcp{6} to detect which ports are being used/served in a workspace. While this works reliably, it has the major downside that we cannot tell wich process serves this port - information that would be handy to display. Also, because of the polling delay, there's a delay in port detection.
Possible solutions
seccomp-notify
User-namespaced workspaces make use of seccomp-notify. We could get notifications on accept, and use the sockfd to get more information about the socket (which port, which address). workspacekit would then provide a Unix socket on which we serve port status information (either re-using supervisor's StatusService or coming up with our own).
Alternatively, workspacekit could provide a file in a well-known location that offers port -> PID mappings, which we'd use to enhance the port information.
scanning /proc
To identify the process that's serving a port, we could also scan /proc and match the sockets inode with the process FD. With proper caching it's conceivable that this solution could come in at an acceptable CPU/performance cost.
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.
Research direction
Start by tracing supervisor's current /proc/net/tcp{6} port scan and reviewing components/supervisor-api/status.proto, then compare the seccomp-notify and /proc approaches described in the issue. Done means port status includes the serving process and avoids the current detection delay, but the implementation direction must first be settled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, typescript
- Domain
- backend, networking, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100