Repository navigation
Bind the backend server to loopback interfaces - #1750
Merged
Merged
Conversation
Signed-off-by: Timothy Wang <[email protected]>
yili-db
approved these changes
Aug 6, 2026
3 of 4 tasks
yili-db
pushed a commit
that referenced
this pull request
Oct 26, 2026
…L transcoder (#1979) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Today the launcher runs a Vert.x verticle on the client port. It forwards every request over HTTP/1.1 to Armeria on `port + 1`. It does one rewrite: Iceberg's nested-namespace separator `%1F` becomes `.`, in the path and in query values. Unity Catalog has no nested namespaces, so that rewrite doesn't make any request succeed. It only changes which error a client gets for a name it could never resolve. #1918 had to size the transcoder's connection pool to the JDBC pool, and answer `/livez` in front of it, so a saturated proxy wouldn't become the bottleneck. Removing the transcoder makes all of that unnecessary. This change: - removes `URLTranscoderVerticle` and the `vertx-core`, `vertx-web` and `vertx-web-client` dependencies; - binds Armeria to the `-p` port in `main`, instead of `port + 1`, and closes the server if it can't start; - binds the API port on all interfaces. Clients now connect to it directly, and the loopback bind from #1750 only existed because the transcoder sat in front; - drops the `port + 1` handling from the observability-port check; - updates `docs/server/observability.md`, which described the client port and the internal `port + 1` API port. **Reasons** - **Simpler implementation:** the server runs as one Armeria process on one port, with no Vert.x proxy in front. - About 410 lines go, including the transcoder and its 250-line test. - **Removes the unused `\^_` transcoding:** Unity Catalog has no nested namespaces, so rewriting `%1F` to `.` never made a request succeed. - **Fewer dependencies:** `vertx-core`, `vertx-web` and `vertx-web-client` are removed, so there are fewer libraries to patch for CVEs. - **No proxy pool to size:** the workarounds #1918 needed go away, i.e. matching the proxy pool to JDBC and answering `/livez` in front of it. - **Better tail latency under load:** cheap requests no longer queue for a shared HTTP/1.1 connection pool or run through a single Vert.x thread. - The saving per request is small, under a millisecond; the gain is mostly in p99 under concurrency. - **Fixes Datadog spans:** spans aren't closed properly, likely because the Datadog agent doesn't support the Vert.x transcoder, so they stay open until the client drops the idle connection about 30s later. - **No more hidden proxy behaviour:** request and response bodies are no longer held in memory, there are no unconfigurable timeouts, and the code that caused bugs #1716 and #1855 is gone. - **Real client addresses:** Armeria sees the caller's actual IP instead of `127.0.0.1`, which helps logging and metrics. - **HTTP/2 end to end:** HTTP/2 clients reach Armeria directly instead of being downgraded to HTTP/1.1. **Behavior changes** - The server listens on one API port. Nothing binds `port + 1` any more. - The API port is reachable from other machines again, as it was before #1750. Deployments that put a network policy in front of it are unaffected. - `GET /v1/catalogs/{c}/namespaces/a%1Fb` and `GET /v1/catalogs/{c}/namespaces?parent=a%1Fb` now return `404 NoSuchNamespaceException` instead of `400`. Neither form ever matched a schema. - The `hostname_pattern` label of `http_server_requests_total` now names the `-p` port (`*:8080` by default) instead of `port + 1` (`*:8081`). Dashboards or alerts that filter on `*:8081` need updating. - One fewer hop and one fewer HTTP/1.1 connection pool per request. HTTP/2 clients now reach Armeria directly. No REST API, property, or CLI changes. **Verification** - `build/sbt javafmtAll` - `build/sbt "server/testOnly io.unitycatalog.server.ArmeriaServerBuilderTest io.unitycatalog.server.UnityCatalogServerTest io.unitycatalog.server.UnityCatalogServerShutdownTest io.unitycatalog.server.EventLoopStallTest io.unitycatalog.server.service.IcebergRestCatalogTest"`: 42 tests. The first run had one `ServerPortBindException` on a random test port. `IcebergRestCatalogTest` then passed 26/26 on rerun. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: s-maling-celonis <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
docsis updatedDescription of changes
The backend HTTP server is meant to receive requests only from the URL transcoder running on the same machine.
Before this change, the backend listened on every network interface. For example, another machine on the same network could try to connect directly to the backend port instead of going through the URL transcoder.
This change binds the backend to loopback interfaces only. The URL transcoder can still reach it, but other machines cannot connect to that port.
A new test checks that every backend listener uses a loopback address. The existing URL transcoder tests still pass.
Tests:
sbt -batch javafmtCheckAllandsbt -batch "server/testOnly io.unitycatalog.server.ArmeriaServerBuilderTest io.unitycatalog.server.URLTranscoderVerticleTest"