Skip to content

Commit

Permalink
Stop the log stream before the header time streamer
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Nov 2, 2023
1 parent 2dfc6f8 commit 4619a37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/run_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ func (r *JobRunner) cleanup(ctx context.Context, wg *sync.WaitGroup, exit proces
// were left behind because the uploader goroutine exited before it could flush them.
r.logStreamer.Process(r.output.ReadAndTruncate())

// Stop the header time streamer. This will block until all the chunks have been uploaded
r.headerTimesStreamer.Stop()

// Stop the log streamer. This will block until all the chunks have been uploaded
r.logStreamer.Stop()

// Stop the header time streamer. This will block until all the chunks have been uploaded
r.headerTimesStreamer.Stop()

// Warn about failed chunks
if count := r.logStreamer.FailedChunks(); count > 0 {
r.agentLogger.Warn("%d chunks failed to upload for this job", count)
Expand Down

0 comments on commit 4619a37

Please sign in to comment.