Skip to content

Commit 14a1894

Browse files
[supervisor] Fix subscription leaks in PortsStatus (#20332)
* Increase port status subscription limit * Properly close supervisor status service connections
1 parent 825fb44 commit 14a1894

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

components/local-app/pkg/bastion/bastion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ func (b *Bastion) tunnelPorts(ws *Workspace) {
760760
}
761761

762762
func (b *Bastion) doTunnelPorts(ctx context.Context, ws *Workspace) error {
763+
ctx, cancel := context.WithCancel(ctx)
764+
defer cancel()
765+
763766
statusService := supervisor.NewStatusServiceClient(ws.supervisorClient)
764767
status, err := statusService.PortsStatus(ctx, &supervisor.PortsStatusRequest{
765768
Observe: true,

components/supervisor/pkg/ports/served-ports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type ServedPortsObserver interface {
4040
}
4141

4242
const (
43-
maxSubscriptions = 10
43+
maxSubscriptions = 100
4444

4545
fnNetTCP = "/proc/net/tcp"
4646
fnNetTCP6 = "/proc/net/tcp6"

0 commit comments

Comments
 (0)