Skip to content

fix(wss): terminate disconnected container log streams#4836

Open
gilangh wants to merge 1 commit into
Dokploy:canaryfrom
gilangh:codex/fix-stuck-log-reads
Open

fix(wss): terminate disconnected container log streams#4836
gilangh wants to merge 1 commit into
Dokploy:canaryfrom
gilangh:codex/fix-stuck-log-reads

Conversation

@gilangh

@gilangh gilangh commented Jul 16, 2026

Copy link
Copy Markdown

What is this PR about?

Closes #4835.

The runtime Logs tab streams through /docker-container-logs. Previously, local streams ran docker logs --follow behind a shell/PTTY and disconnect cleanup only killed that wrapper; remote cleanup only ended the SSH client. Cleanup was also registered after asynchronous authentication/server lookup, leaving a race where a browser could disconnect before the log process was tracked.

This change:

  • registers disconnect cleanup before asynchronous work starts;
  • spawns the local Docker CLI directly, then escalates SIGTERM to SIGKILL after one second if needed;
  • explicitly signals and closes remote SSH log channels;
  • closes browser WebSockets that unmount while still connecting;
  • keeps search behavior with chunk-safe, case-insensitive server-side filtering.

Checklist

Before submitting this PR, please make sure that:

Validation performed with Node.js 24.4.0:

  • pnpm exec vitest --config __test__/vitest.config.ts __test__/wss/utils.test.ts --run (22 tests passed)
  • pnpm --filter=dokploy typecheck
  • pnpm --filter=@dokploy/server typecheck
  • pnpm --filter=dokploy build-server
  • Biome check on all changed files

Issues related (if applicable)

Closes #4835.

Screenshots (if applicable)

Not applicable; this changes server-side process lifecycle and disconnect handling.

@gilangh
gilangh marked this pull request as ready for review July 16, 2026 13:06
@gilangh
gilangh requested a review from Siumauricio as a code owner July 16, 2026 13:06
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 16, 2026
AminDhouib added a commit to DevinoSolutions/dokploy-community that referenced this pull request Jul 18, 2026
port: fix(wss): terminate disconnected container log streams (upstream Dokploy#4836)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker daemon CPU saturation after redeploy while Logs tab is open

1 participant