-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: use runtime.AddCleanup in the standard library #70907
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
Comments
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/638555 mentions this issue: |
Change https://go.dev/cl/638557 mentions this issue: |
Change https://go.dev/cl/638556 mentions this issue: |
Change https://go.dev/cl/638578 mentions this issue: |
Change https://go.dev/cl/638576 mentions this issue: |
Change https://go.dev/cl/638579 mentions this issue: |
Change https://go.dev/cl/638575 mentions this issue: |
Change https://go.dev/cl/638577 mentions this issue: |
This is a step toward using AddCleanup rather than SetFinalizer to close process handles. For #70907 Change-Id: I7fb37461dd67b27135eab46fbdae94f0058ace85 Reviewed-on: https://go-review.googlesource.com/c/go/+/638575 Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
It's now redundant with checking whether the handle field is nil. For #70907 Change-Id: I877f2a7c63d15ab5f8e3d2c9aa24776c2e3e2056 Reviewed-on: https://go-review.googlesource.com/c/go/+/638576 Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]>
We only need a reference count in processHandle. For #70907 Fixes #71564 Change-Id: I209ded869203dea10f12b070190774fb5f1d3d71 Reviewed-on: https://go-review.googlesource.com/c/go/+/638577 Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
Since it no longer holds a reference count, just use values. For #70907 Change-Id: I19a42583988d4f8a9133b1c837356ca0179d688c Reviewed-on: https://go-review.googlesource.com/c/go/+/638578 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
There is no reason to use a cleanup/finalizer for a Process that doesn't use a handle, because Release doesn't change anything visible about the process. For #70907 Change-Id: I3b92809175523ceee2e07d601cc2a8e8b86321e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/638579 Reviewed-by: Carlos Amedee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
Change https://go.dev/cl/640735 mentions this issue: |
This changes the finalizer mechanism used to close files from runtime.SetFinalizer to runtime.AddCleanup. Updates #70907 Change-Id: I47582b81b0ed69609dd9dac158ec7bb8819c8c77 Reviewed-on: https://go-review.googlesource.com/c/go/+/638555 Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Carlos Amedee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Replace the usage of runtime.SetFinalizer with runtime.AddCleanup. Updates #70907 Change-Id: Id604ca44ea67dcf8f87797e27347c6f4e9ad0b86 Reviewed-on: https://go-review.googlesource.com/c/go/+/638556 Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Carlos Amedee <[email protected]> TryBot-Bypass: Carlos Amedee <[email protected]>
Change https://go.dev/cl/640736 mentions this issue: |
Change https://go.dev/cl/648655 mentions this issue: |
This changes the use of finalizers to the cleanup implementation in tests. Updates #70907 Change-Id: I7d7289999a83fa53f538698f34294f7d9651c921 Reviewed-on: https://go-review.googlesource.com/c/go/+/640735 Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Replace the usage of runtime.SetFinalizer with runtime.AddCleanup. This changes a test and how when the Go command panics when a file is left locked. Updates #70907 Change-Id: I8d8c56d16486728f9bd4b910b81796ae506bda74 Reviewed-on: https://go-review.googlesource.com/c/go/+/640736 Reviewed-by: Sam Thanawalla <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Replace the usage of runtime.SetFinalizer with runtime.AddCleanup in tests. Updates #70907 Change-Id: Idd3f1c07f6a7709352ca09948fbcb4a0ad9418bb Reviewed-on: https://go-review.googlesource.com/c/go/+/648655 Auto-Submit: Carlos Amedee <[email protected]> Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Change https://go.dev/cl/649459 mentions this issue: |
Change https://go.dev/cl/649458 mentions this issue: |
Replace the usage of runtime.SetFinalizer with runtime.AddCleanup in tests. Updates #70907 Change-Id: I0d91b6af9643bde278215318f6176277373ddd19 Reviewed-on: https://go-review.googlesource.com/c/go/+/649458 Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
This change adds a test case for runtime.AddCleanup. Updates #70907 Change-Id: I29cba9dc5b40cec8e610215974e61ee47e10d00f Reviewed-on: https://go-review.googlesource.com/c/go/+/649459 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
Change https://go.dev/cl/664275 mentions this issue: |
Change https://go.dev/cl/667555 mentions this issue: |
Change https://go.dev/cl/667595 mentions this issue: |
AddCleanup has been added to the runtime (#67535). We should use runtime.AddCleanup instead of runtime.SetFinalizer in the standard library wherever it is possible.
Remaining instances of SetFinalizer (outside of runtime):
@mknyszek
The text was updated successfully, but these errors were encountered: