Skip to content

feat(docker): resolve the Hasura instances at run time in the nginx image - #26349

Merged
TiagoJacobs merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:fix/hasura-lb-resolve
Nov 24, 2026
Merged

TiagoJacobs merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:fix/hasura-lb-resolve

Conversation

@tibroc

@tibroc tibroc commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

The nginx image's Hasura balancer gets resolve on its one server line:

server graphql-server:8085 resolve;

nginx now looks the name up again every 30 s through the resolver the image already has for
webhooks (#26217), with the zone from #26248. More or fewer graphql-server instances behind the one
name take effect within 30 s, without nginx -s reload. The README paragraph on the edge nginx says
which names are resolved at run time.

Closes Issue(s)

None

Motivation

Follow-up to the review of #26217 (point 4, @antobinary) and the "two Hasuras" question there: until
now nginx resolved graphql-server once at start, so after scaling it had to be reloaded.

Two consequences, both in the README:

  • nginx no longer needs Hasura to resolve at start: it starts, and answers 502 on 8185 until Hasura runs.
  • nginx now needs the resolver to start: without the base image's entrypoint (--entrypoint nginx, or a
    Kubernetes command:) it exits with no resolver defined to resolve names at run time in upstream "hasura". On Kubernetes graphql-server needs its full service name, because nginx's resolver
    ignores search domains (as for webhooks), or the deployment mounts its own
    hasura-loadbalancer.conf.

How to test

Built the nginx image and ran it with a read-only root, stub backends and stub Hasura instances
(nginx returning its host name on 8085) under the alias graphql-server, without reloading nginx:

  • started without any graphql-server: nginx healthy, 8185 answers 502;
  • two instances started: reachable after 32 s; 30 requests split 15/15;
  • a third started: gets traffic after 26 s; 10/10/10;
  • one removed: after 40 s 30 of 30 requests return 200 from the two left (15/15);
  • --entrypoint nginx: exits 1 with the no resolver defined message above.

With the compose setup of #26186 and the published v4.1.x-develop-c90e70a images, only nginx built
from this branch, nginx never reloaded or restarted:

  • docker compose up -d --scale graphql-server=2, after 35 s nginx resolves both addresses; during
    joins both instances get websocket connections; 6 joins and a recorded meeting through to playback
    pass;
  • scaled back to 1: after 35 s both joins pass in 6–7 s, and the nginx log has no line for the
    removed address (without resolve, joins took 17–19 s and nginx logged Host is unreachable until
    a reload).

…mage

With the resolver the image already has for webhooks, more or fewer
graphql-server instances behind the one name take effect within 30 s,
without reloading nginx. nginx also starts before Hasura resolves.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4
  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab6f760e-43fc-44d9-a7fc-6ada4bda93d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antobinary antobinary added this to the Release 4.1 milestone Oct 30, 2026
@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@gustavotrott

Copy link
Copy Markdown
Contributor

@tibroc
A note for the future, not directly related to this PR:

BBB could benefit a lot from routing all users from the same meeting to the same Hasura instance, while routing users from other meetings to different instances.

Since Hasura uses query multiplexing, it can execute a single query for all users in the same meeting. However, if those users are split across two Hasura instances, each instance would need to execute the same query, effectively doubling the number of queries.

Keeping users from the same meeting on the same Hasura instance could significantly reduce resource consumption.

Of course, this would mainly make sense for servers hosting multiple smaller meetings. For a single meeting with a large number of users, distributing the load across multiple Hasura instances might still be necessary.

@TiagoJacobs
TiagoJacobs merged commit 1203989 into bigbluebutton:v4.1.x-develop Nov 24, 2026
50 of 51 checks passed
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Nov 25, 2026
Follow-up to bigbluebutton#26349: scaling takes effect in about 30 s; on Kubernetes the short name does not resolve (own hasura-loadbalancer.conf with the full name) and resolve spreads over several pods only with a headless Service. The comments in the nginx Dockerfile and the compose file still described the resolver as for webhooks only and every upstream as resolved at start.
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Nov 25, 2026
The upstreams were resolved when nginx started, so a service recreated alone with a new address (up -d --force-recreate <service>, or up -d after a change in .env) answered 502 until nginx restarted. Like graphql-server since bigbluebutton#26349, the upstreams of web, graphql-middleware, webrtc-sfu, shared-notes-server, html5-client and learning-dashboard now have a zone and resolve their names every 30 s; livekit keeps its fixed address. docker/README.md describes it, with the Kubernetes note: own files with the full service names, and several pods only behind a headless Service.
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Nov 26, 2026
Follow-up to bigbluebutton#26349: scaling takes effect in about 30 s; on Kubernetes the short name does not resolve (own hasura-loadbalancer.conf with the full name) and resolve spreads over several pods only with a headless Service. The comments in the nginx Dockerfile and the compose file still described the resolver as for webhooks only and every upstream as resolved at start.
imdt-claudiop added a commit to imdt-claudiop/bigbluebutton that referenced this pull request Nov 26, 2026
The upstreams were resolved when nginx started, so a service recreated alone with a new address (up -d --force-recreate <service>, or up -d after a change in .env) answered 502 until nginx restarted. Like graphql-server since bigbluebutton#26349, the upstreams of web, graphql-middleware, webrtc-sfu, shared-notes-server, html5-client and learning-dashboard now have a zone and resolve their names every 30 s; livekit keeps its fixed address. docker/README.md describes it, with the Kubernetes note: own files with the full service names, and several pods only behind a headless Service.
@tibroc
tibroc deleted the fix/hasura-lb-resolve branch November 26, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants