Skip to content

ui: websocket watchers and http2 - #28364

Merged
chrisroberts merged 6 commits into
mainfrom
f-pennnnnnnding-requests
Sep 2, 2026
Merged

chrisroberts merged 6 commits into
mainfrom
f-pennnnnnnding-requests

Conversation

@chrisroberts

@chrisroberts chrisroberts commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Description

The HTTP API currently only supports HTTP/1 and this leads to issues within the UI, especially on chromium based browsers, where the maximum number of HTTP/1 connections is limited. The UI makes use of watchers, which are blocking requests that wait for a change to occur and update the UI. In some places the number of watchers combined with other requests will exceed the limit and result in the UI becoming unresponsive until a transition is made or the page is reloaded.

To remove the connection limit restriction, the UI watchers have been updated to use WebSockets for the blocking requests. The use of WebSockets for watchers happens at request time, so there is no need for refactoring or updating the existing UI implementations. This also allows the use of WebSockets for watchers to be enabled or disabled with a configuration flag (or dynamically based on condition).

Unfortunately, websockets are not available for FIPS builds due to WebSocket's reliance on SHA1 for the handshake and SHA1 not being available within go when FIPS is enabled. To rectify the original issue of the UI becoming unresponsive when WebSockets are not available, enabling HTTP/2 fixes the issue. Note that the UI still uses WebSockets for terminal emulation, and that will be unavailable on FIPS builds.

Ultimately this changeset fixes the issue of the UI becoming unresponsive in two ways and which fix is used is dependent on the Nomad configuration.

WebSockets are used if:

  • TLS is disabled (which is required for browsers to use HTTP/2)
  • HTTP/2 is disabled in the config

HTTP/2 is used if:

  • it is available 🙂

Testing & Reproduction steps

Links

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad product documentation, which is stored in the
    web-unified-docs repo. Refer to the web-unified-docs contributor guide for docs guidelines.
    Please also consider whether the change requires notes within the upgrade
    guide
    . If you would like help with the docs, tag the nomad-docs team in this PR.
  • LLM Usage If an LLM was used to generate any code, please ensure and confirm you have read
    and followed the AI usage guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Comment thread command/agent/config.go Outdated
Comment thread nomad/structs/config/tls.go Outdated
Comment thread command/agent/http.go
@chrisroberts chrisroberts changed the title ui: use websockets for watchers ui: websocket watchers and http2 Aug 6, 2026
@chrisroberts
chrisroberts force-pushed the f-pennnnnnnding-requests branch from 122d36e to 9116035 Compare August 7, 2026 14:43
@chrisroberts
chrisroberts force-pushed the f-pennnnnnnding-requests branch from 9116035 to 08ea0ad Compare August 7, 2026 17:55
@chrisroberts chrisroberts linked an issue Aug 25, 2026 that may be closed by this pull request
@chrisroberts
chrisroberts marked this pull request as ready for review September 1, 2026 16:48
@chrisroberts
chrisroberts requested review from a team as code owners September 1, 2026 16:48
@chrisroberts chrisroberts added backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/2.0.x backport to 2.0.x release line labels Sep 1, 2026

@tgross tgross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work on figuring out this mess of complexity :shipit:

@chrisroberts
chrisroberts merged commit 2d46a7a into main Sep 2, 2026
46 checks passed
@chrisroberts
chrisroberts deleted the f-pennnnnnnding-requests branch September 2, 2026 22:39
schmichael pushed a commit to vercel/nomad that referenced this pull request Sep 25, 2026
Enables API support for HTTP/2 protocol and using WebSockets for watchers in the UI.

This branch was successfully deployed

1 active deployment
Preview — 37ac936e Deployed Sep 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/ent/1.10.x+ent backport to 1.10.x+ent release line backport/ent/1.11.x+ent backport to 1.11.x+ent release line backport/2.0.x backport to 2.0.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Browser reaching max connection limit

2 participants