diff options
| author | Will Hawkins <[email protected]> | 2023-04-25 22:55:58 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2023-04-25 23:00:20 -0400 |
| commit | a0e0b1861d5b2d0d77e728042c915f5b7742e744 (patch) | |
| tree | 92183a973f532737c13ea9913ebf78e972037e01 /rpm | |
| parent | c9a33075c873c4ef8bb3c695cce721172c31d361 (diff) | |
[Bugfix] Tighten up check for probe connection reuse
Even with previous fixes it was *still* possible for a self-down probe
to have started before the underlying load-generating connection came
online (or so it seems!). This patch will move changing the status of an
underlying lgc from not-running state to running state even later to
eliminate even the smallest possible gap.
Re: #47
Diffstat (limited to 'rpm')
| -rw-r--r-- | rpm/rpm.go | 60 |
1 files changed, 38 insertions, 22 deletions
@@ -158,30 +158,46 @@ func CombinedProber( ) // Start Self Download Connection Prober - go probe.Probe( - networkActivityCtx, - &wg, - selfDownProbeConnection.Client(), - selfProbeConfiguration.URL, - selfProbeConfiguration.Host, - probe.SelfDown, - &dataPoints, - captureExtendedStats, - debugging, - ) + + // TODO: Make the following sanity check more than just a check. + // We only want to start a SelfDown probe on a connection that is + // in the RUNNING state. + if selfDownProbeConnection.Status() == lgc.LGC_STATUS_RUNNING { + go probe.Probe( + networkActivityCtx, + &wg, + selfDownProbeConnection.Client(), + selfProbeConfiguration.URL, + selfProbeConfiguration.Host, + probe.SelfDown, + &dataPoints, + captureExtendedStats, + debugging, + ) + } else { + panic(fmt.Sprintf("(%s) Combined probe driver evidently lost its underlying connection (Status: %v).\n", debugging.Prefix, selfDownProbeConnection.Status())) + } // Start Self Upload Connection Prober - go probe.Probe( - proberCtx, - &wg, - selfUpProbeConnection.Client(), - selfProbeConfiguration.URL, - selfProbeConfiguration.Host, - probe.SelfUp, - &dataPoints, - captureExtendedStats, - debugging, - ) + + // TODO: Make the following sanity check more than just a check. + // We only want to start a SelfDown probe on a connection that is + // in the RUNNING state. + if selfUpProbeConnection.Status() == lgc.LGC_STATUS_RUNNING { + go probe.Probe( + proberCtx, + &wg, + selfUpProbeConnection.Client(), + selfProbeConfiguration.URL, + selfProbeConfiguration.Host, + probe.SelfUp, + &dataPoints, + captureExtendedStats, + debugging, + ) + } else { + panic(fmt.Sprintf("(%s) Combined probe driver evidently lost its underlying connection (Status: %v).\n", debugging.Prefix, selfUpProbeConnection.Status())) + } } if debug.IsDebug(debugging.Level) { fmt.Printf( |
