Repository navigation
Commit d055a8a
authored
feat(bigtable): add NoOpChannelPrimer for session channel pools (#20208)
## Summary
Adds a `NoOpChannelPrimer` implementation of `ChannelPrimer` that
explicitly disables per-connection priming. Session channel pools warm
their channels via the OpenSession handshake on each newly-opened
stream, so a PingAndWarm at dial time is redundant.
The `ChannelPrimer` contract already allows nil-as-\"no priming\" (see
the factory's nil-primer branch), but nil is a placeholder-shaped
sentinel — easy to misread as \"primer not wired up yet\" rather than a
deliberate architectural choice. `NoOpChannelPrimer` makes the intent
explicit at the construction site and gives the follow-up SessionClient
refactor a named type to plumb.
## Changes
- **`channel_primer.go`** — new `NoOpChannelPrimer struct{}` + `Prime`
method returning nil; interface docstring extended to name it alongside
`pingAndWarmChannelPrimer`.
- **`channel_primer_test.go`** — three new tests:
- `TestNoOpChannelPrimer_Prime` — returns nil and doesn't dereference
the connection.
- `TestNoOpChannelPrimer_ImplementsChannelPrimer` — compile-time guard
on interface satisfaction.
- `TestConnectionFactory_NoOpPrimerSkipsPriming` — composes into the
existing `connectionFactory` the same way nil does; no PingAndWarm on
the wire.
## Test plan
- [x] \`go test ./bigtable/internal/transport/ -run
'ChannelPrimer|Primer|Prime' -count=1 -short\` → 4/4 relevant +
PingAndWarm suite all pass locally.
- [x] \`go build ./bigtable/internal/transport/\` clean.
- [x] \`go vet ./bigtable/internal/transport/\` clean.
- [x] \`golint\` clean.
- [x] CI green (post-rebase + consolidation).1 parent 2fcfe5f commit d055a8a
2 files changed
Lines changed: 60 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
92 | 89 | | |
| 90 | + | |
93 | 91 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
97 | 110 | | |
98 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
99 | 125 | | |
100 | | - | |
101 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
102 | 130 | | |
103 | 131 | | |
0 commit comments