Fix isTraceStack on newer Go versions #68
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #66 .
On newer Go versions (1.16 onwards), the top of trace stacks is no longer
runtime.goparkunlock
. We had a logic that relied on this being the case, which made the tests to fail with-trace
flag for newer Go versions. However, to maintain backwards compatibility, we shouldn't just remove this check.This separates out the
isTraceStack
into a separate file that gets conditionally compiled on different Go versions (tracestack_old.go
for Go 1.15 and before andtracestack_new.go
for Go 1.16 and newer) to address this issue.Internal Ref: GO-887.