You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
runtime,runtime/pprof: clean up goroutine leak profile writing
Cleaned up goroutine leak profile extraction:
- removed the acquisition of goroutineProfile semaphore
- inlined the call to saveg when recording stacks instead of using
doRecordGoroutineProfile, which had side-effects over
goroutineProfile fields.
Added regression tests for goroutine leak profiling frontend for binary
and debug=1 profile formats.
Added stress tests for concurrent goroutine and goroutine leak profile requests.
Change-Id: I55c1bcef11e9a7fb7699b4c5a2353e594d3e7173
GitHub-Last-Rev: 5e9eb3b
GitHub-Pull-Request: #76045
Reviewed-on: https://go-review.googlesource.com/c/go/+/714580
Reviewed-by: Michael Pratt <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Junyang Shao <[email protected]>
t.Errorf("leaked goroutine stack expected %s as the location[%d].Line[%d] but found %s (%s:%d)", expectedFunctionName, i, j, location.Line[j].Function.Name, location.Line[j].Function.Filename, location.Line[j].Line)
1608
+
}
1609
+
}
1610
+
1611
+
// We use this helper to count the total number of leaked goroutines in the profile.
1612
+
//
1613
+
// NOTE(vsaioc): This value should match for the number of leaks produced in this test,
1614
+
// but other tests could also leak goroutines, in which case we would have a mismatch
1615
+
// when bulk-running tests.
1616
+
//
1617
+
// The two mismatching outcomes are therefore:
1618
+
// - More leaks than expected, which is a correctness issue with other tests.
1619
+
// In this case, this test effectively checks other tests wrt
1620
+
// goroutine leaks during bulk executions (e.g., running all.bash).
1621
+
//
1622
+
// - Fewer leaks than expected; this is an unfortunate symptom of scheduling
1623
+
// non-determinism, which may occur once in a blue moon. We make
1624
+
// a best-effort attempt to allow the expected leaks to occur, by yielding
0 commit comments