there wouldOn Mon, Feb 24, 2025 at 12:35 PM 'Paul Ruane' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > I hit a problem today whereby a gRPC call did not come back with a status of > cancelled, despite the request context being cancelled. > > Tracing it through I found that it was because of a failed DNS lookup and > that the DNS code does not propagate the context cancelled error. I was > wondering if there was a particular reason for this? > > In the code at these locations (at least), the `context.Canceled` error is > mapped to a `net.CanceledError` (which has unwrap semantics), but is then > promptly converted to a string: > > • > https://github.com/golang/go/blob/2ee775fd9b58247618cf8bc06935f33875bdc872/src/net/cgo_unix.go#L52 > • > https://github.com/golang/go/blob/2ee775fd9b58247618cf8bc06935f33875bdc872/src/net/cgo_unix.go#L82 > > The struct `DNSError` does actually have a field called `UnwrapErr`, but it > does not get populated in these cases. I was going to raise an issue but > thought I would check here first.
What you are describing is basically https://go.dev/issue/63109 which led to https://go.dev/issue/63116. I think you've found a bug in the code that addressed those issues (https://go.dev/cl/532217). Please open a new issue. Thanks. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWxs1SRCv3ZxPpUd0m6uTVftgTrL-Z8j5GN8BehfDdWAg%40mail.gmail.com.