Commit 268fa12
committed
Mark singleServerPool's connection lcActive at construction
singleServerPool's OnSuccess/OnFailure are no-ops, so a connection
placed in this pool would otherwise stay at its initial lifecycle
(typically lcUnknown / "dead") for the lifetime of the pool. Anything
that reads lifecycle state via buildConnectionMetric -- the metrics
API, test readiness gates that lens connection health into the
readiness FSM, future observers -- would then incorrectly classify
the only available connection as not-ready, even after it had served
requests successfully.
multiServerPool already does the right thing: when it constructs a
pool with initial conns it CAS's lcActive on each one (clearing
lcUnknown|lcStandby). This change applies the same transition to
singleServerPool by routing all four construction sites through a
new newSingleServerPool(conn, *metrics) helper that performs the
CAS under conn.mu before returning.
Behavior is otherwise unchanged. Existing multiServerPool->
singleServerPool demotion paths preserve their connection's
existing state (the CAS is a no-op when lcActive is already set).
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>1 parent 8576815 commit 268fa12
4 files changed
Lines changed: 47 additions & 11 deletions
File tree
- opensearchtransport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
| 874 | + | |
878 | 875 | | |
879 | 876 | | |
880 | 877 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
2385 | 2385 | | |
2386 | 2386 | | |
2387 | 2387 | | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
| 2388 | + | |
2392 | 2389 | | |
2393 | 2390 | | |
2394 | 2391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
19 | 61 | | |
20 | 62 | | |
21 | 63 | | |
| |||
0 commit comments