From 00cd532f0c6860e11902240411204418db79e0d0 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Fri, 19 Jan 2024 19:33:29 -0500 Subject: [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 --- lgc/upload.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lgc') 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 -- cgit v1.2.3