Commit 4934ad8
authored
fix(gax-grpc): add pick_first fallback to direct path service config (#4143)
The `Dependency Compatibility Test` CI workflow has been failing on the
`InstantiatingGrpcChannelProviderTest` tests (e.g.
`canUseDirectPath_happyPath`) with the following error during
initialization:
`java.lang.IllegalStateException: Default config is invalid:
Status{code=UNKNOWN, description=None of [grpclb] specified by Service
Config are available., cause=null}`
**Root Cause & DNS Spam Issue:**
As of `grpc-java` v1.77.0, the `grpc-grpclb` artifact is no longer
implicitly included because the legacy `grpclb` load balancer plugin is
deprecated (Tracked in #4012). However,
`InstantiatingGrpcChannelProvider` still hardcoded `grpclb` as its
primary DirectPath load balancing policy.
This missing plugin crashes tests, but the backend Google `grpclb`
lookaside servers were also officially turned down in July 2025. Because
the library still explicitly requests `grpclb`, it causes gRPC to
continuously spam DNS with `_grpclb._tcp.*` SRV queries trying to find
those dead servers. This leads to ~22,000 NXDOMAIN DNS errors a day on
user networks (Tracked in
googleapis/java-pubsub#2404).
**Fix:**
This PR completely removes `grpclb` and replaces it with `pick_first` in
`getDefaultDirectPathServiceConfig()`.
We deliberately choose `pick_first` to preserve the original 2019 design
intent (maintaining exactly one connection per pooled GAX channel to
emulate CFE behavior) and to provide a safe, fail-open default. While
Traffic Director relies on the `xds` API, configuring it as a default
fallback would require complex bootstrap configurations and cause
crashes for clients
without that setup. `pick_first` stops the DNS spam entirely, ensures
stability on modern gRPC versions, and resolves the test failures.1 parent 48764e0 commit 4934ad8
File tree
2 files changed
+8
-17
lines changed- sdk-platform-java/gax-java/gax-grpc/src
- main/java/com/google/api/gax/grpc
- test/java/com/google/api/gax/grpc
2 files changed
+8
-17
lines changedLines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
1437 | | - | |
| 1437 | + | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
| |||
1443 | 1443 | | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
| 1446 | + | |
| 1447 | + | |
1453 | 1448 | | |
1454 | 1449 | | |
1455 | 1450 | | |
| |||
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
| 552 | + | |
557 | 553 | | |
558 | 554 | | |
559 | 555 | | |
| |||
599 | 595 | | |
600 | 596 | | |
601 | 597 | | |
602 | | - | |
603 | | - | |
| 598 | + | |
| 599 | + | |
604 | 600 | | |
605 | | - | |
| 601 | + | |
606 | 602 | | |
607 | 603 | | |
608 | 604 | | |
| |||
0 commit comments