Skip to content

Commit 2832961

Browse files
mknyszekgopherbot
authored andcommitted
internal/trace: emit a Sync event even if the next generation is broken
Since CL 644215 each Sync event now represents the coming generation, with a final Sync event emitted even when there's nothing ahead. This change however failed to emit a Sync event at the end of a completely valid generation when the next generation was invalid, causing the runtime test TestCrashWhileTracing to start failing. Fix this by emitting a final Sync event even when the next generation is broken. We hold onto the error in parsing the next generation and emit it after that final Sync event. (Should these "final" Sync events distinguish themselves in some way?) Fixes #71615. Change-Id: I1f8abee5abaa39e1219e6fa05e9f82f1478db4c9 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/648195 Auto-Submit: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent ee8db08 commit 2832961

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/internal/trace/reader.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,10 @@ func (r *Reader) ReadEvent() (e Event, err error) {
152152
return syncEvent(nil, r.lastTs, r.syncs), nil
153153
}
154154
// Read the next generation.
155-
var err error
156-
r.gen, r.spill, err = readGeneration(r.r, r.spill)
155+
r.gen, r.spill, r.spillErr = readGeneration(r.r, r.spill)
157156
if r.gen == nil {
158-
return Event{}, err
157+
return syncEvent(nil, r.lastTs, r.syncs), nil
159158
}
160-
r.spillErr = err
161159

162160
// Reset CPU samples cursor.
163161
r.cpuSamples = r.gen.cpuSamples

0 commit comments

Comments
 (0)