microsoft / go-winio

Win32 IO-related utilities for Go
MIT License
946 stars 180 forks source link

Assign ErrPipeListenerClosed to net.ErrClosed #242

Closed dcantah closed 2 years ago

dcantah commented 2 years ago

This error used to just be a errors.New with the text exactly matching the "use of closed network connection" that you'd get from the Go stdlib. Now that that error was exported as net.ErrClosed in Go 1.16 we should be able to swap to this safely.

dcantah commented 2 years ago

CI's using Go 1.15.5 and that's the reason for the fail, will look in a little. Edit: Our tests didn't specify a go-version, fixed.

dcantah commented 2 years ago

@thaJeztah I could only see here where moby was making use of this, and it seems like the usage would continue working. Maybe our comment was out of date 🤷‍♂️ https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/libcontainerd/remote/client_io_windows.go#L84-L86.

There's these two spots that check the error text but they're both using tcp/http conns, so not really relevant.

  1. https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/integration/internal/requirement/requirement.go#L20
  2. https://github.com/moby/moby/blob/7b9275c0da707b030e62c96b679a976f31f929d3/cmd/dockerd/metrics.go#L27
dcantah commented 2 years ago

fyi @katiewasnothere @ambarve as I think we'd talked about this before

dcantah commented 2 years ago

@katiewasnothere @ambarve Anybody able to give this a look?