-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Go back-compatibility in Accept error check.
Emit the message as DEBUG, so logs avoid false positive errors. net.ErrClosed was added in Go 1.16, but this project's go.mod specifies Go 1.13. We alias Go's internal error type, to avoid the worse alternative of comparing the string of the error message. Go maintainers discuss this topic at length in golang/go#4373. Occurences of "use of closed network connection" are not an actual problem. It's advisory only, akin to io.EOF.
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build !go1.16 | ||
// +build !go1.16 | ||
|
||
package plugin | ||
|
||
import _ "unsafe" | ||
|
||
// NetErrClosed aliases the internal error type poll.ErrNetClosing. | ||
// FUTURE: When Go 1.16 is the minimum supported version for go-plugin, switch to net.ErrClosed. | ||
//go:linkname NetErrClosed internal/poll.ErrNetClosing | ||
var NetErrClosed error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//go:build go1.16 | ||
// +build go1.16 | ||
|
||
package plugin | ||
|
||
import "net" | ||
|
||
var NetErrClosed = net.ErrClosed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters