Commit a2f5f26
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 404154e commit a2f5f26
4 files changed
Lines changed: 31 additions & 10 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 | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 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 | + | |
19 | 46 | | |
20 | 47 | | |
21 | 48 | | |
| |||
0 commit comments