-
Notifications
You must be signed in to change notification settings - Fork 18.1k
context: prevent creation of invalid contexts #37898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
This PR (HEAD: f0ae60d) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/223777 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This commit makes it impossible to create derived contexts with nil parents. Previously it was possible to create derived contexts with nil parents, and invalid contexts could propagate through the program. Eventually this could cause a panic downstream, which is difficult to trace back to the source of the error.
f0ae60d
to
f404080
Compare
This PR (HEAD: f404080) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/223777 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 2: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 2: TryBots beginning. Status page: https://farmer.golang.org/try?commit=fce6559c Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 2: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This PR (HEAD: f051f22) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/223777 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 5: Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 5: TryBots beginning. Status page: https://farmer.golang.org/try?commit=13b248c9 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 5: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Bryan C. Mills: Patch Set 5: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This PR (HEAD: 41768f1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/223777 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 7: Does "go test context" pass on your system? Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Kyle Nusbaum: Patch Set 7: "go test context" passes now on my system. Sorry, this is my first contribution and I was having trouble running the tests. I believe I have fixed them and it should all be passing now. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Ian Lance Taylor: Patch Set 7: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 7: TryBots beginning. Status page: https://farmer.golang.org/try?commit=06103d5f Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 7: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Bryan C. Mills: Patch Set 7: Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Ian Lance Taylor: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This PR (HEAD: 1b7dadd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/223777 to see it. Tip: You can toggle comments from me using the |
Message from Ian Lance Taylor: Patch Set 8: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 8: TryBots beginning. Status page: https://farmer.golang.org/try?commit=b52ea257 Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Kyle Nusbaum: Patch Set 8: (1 comment) Fixed the trailing period in all panic messages. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
Message from Gobot Gobot: Patch Set 8: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This commit makes it impossible to create derived contexts with nil parents. Previously it was possible to create derived contexts with nil parents, and invalid contexts could propogate through the program. Eventually this can cause a panic downstream, which is difficult to trace back to the source of the error. Although `WithCancel` and `WithDeadline` already panic if `parent` is `nil`, this adds explicit checks to give a useful message in the panic. Fixes #37908 Change-Id: I70fd01f6539c1b0da0e775fc5457e32e7075e52c GitHub-Last-Rev: 1b7dadd GitHub-Pull-Request: #37898 Reviewed-on: https://go-review.googlesource.com/c/go/+/223777 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Message from Ian Lance Taylor: Patch Set 8: Code-Review+2 Thanks. Please don’t reply on this GitHub thread. Visit golang.org/cl/223777. |
This PR is being closed because golang.org/cl/223777 has been merged. |
This commit makes it impossible to create derived contexts with nil parents.
Previously it was possible to create derived contexts with nil parents, and
invalid contexts could propogate through the program. Eventually this can
cause a panic downstream, which is difficult to trace back to the source
of the error.
Although
WithCancel
andWithDeadline
already panic ifparent
isnil
, this adds explicit checks to give a useful message in the panic.Fixes #37908