summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2024-01-19 19:33:29 -0500
committerWill Hawkins <[email protected]>2024-01-19 19:40:03 -0500
commit00cd532f0c6860e11902240411204418db79e0d0 (patch)
tree60ab427e86e2e6867263921d9fcd6b89c65eedb6
parent65c625a6258e0c354c26babba51455985c541261 (diff)
[Bugfix] Marking Upload LGC as Running Too Soon
By marking an upload LGC as running earlier than it was actually started meant that there was a possibility that a probe started on that connection before the load-generating upload. That caused a violation of some invariants and caused panics. Signed-off-by: Will Hawkins <[email protected]>
-rw-r--r--lgc/upload.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/lgc/upload.go b/lgc/upload.go
index 2da1782..23eef21 100644
--- a/lgc/upload.go
+++ b/lgc/upload.go
@@ -54,7 +54,9 @@ type LoadGeneratingConnectionUpload struct {
statusWaiter *sync.Cond
}
-func NewLoadGeneratingConnectionUpload(url string, keyLogger io.Writer, connectToAddr string, insecureSkipVerify bool, congestionControl *string) LoadGeneratingConnectionUpload {
+func NewLoadGeneratingConnectionUpload(url string, keyLogger io.Writer, connectToAddr string,
+ insecureSkipVerify bool, congestionControl *string,
+) LoadGeneratingConnectionUpload {
lgu := LoadGeneratingConnectionUpload{
URL: url,
KeyLogger: keyLogger,
@@ -320,11 +322,6 @@ func (lgu *LoadGeneratingConnectionUpload) doUpload(ctx context.Context) error {
lgu.uploadStartTime = time.Now()
lgu.lastIntervalEnd = 0
- lgu.statusLock.Lock()
- lgu.status = LGC_STATUS_RUNNING
- lgu.statusWaiter.Broadcast()
- lgu.statusLock.Unlock()
-
if resp, err = lgu.client.Do(request); err != nil {
lgu.statusLock.Lock()
lgu.status = LGC_STATUS_ERROR