Skip to content

Commit

Permalink
[supervisor] Fix subscription leaks in PortsStatus (#20332)
Browse files Browse the repository at this point in the history
* Increase port status subscription limit

* Properly close supervisor status service connections
  • Loading branch information
filiptronicek authored Oct 30, 2024
1 parent 825fb44 commit 14a1894
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/local-app/pkg/bastion/bastion.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,9 @@ func (b *Bastion) tunnelPorts(ws *Workspace) {
}

func (b *Bastion) doTunnelPorts(ctx context.Context, ws *Workspace) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()

statusService := supervisor.NewStatusServiceClient(ws.supervisorClient)
status, err := statusService.PortsStatus(ctx, &supervisor.PortsStatusRequest{
Observe: true,
Expand Down
2 changes: 1 addition & 1 deletion components/supervisor/pkg/ports/served-ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type ServedPortsObserver interface {
}

const (
maxSubscriptions = 10
maxSubscriptions = 100

fnNetTCP = "/proc/net/tcp"
fnNetTCP6 = "/proc/net/tcp6"
Expand Down

0 comments on commit 14a1894

Please sign in to comment.