jhump commented on PR #384: URL: https://github.com/apache/iceberg-go/pull/384#issuecomment-2808046336
I've added a test. The test does not actually verify anything and passes, even if there's a concurrency bug, unless the race detector is enabled. With the race detector enabled, it did fail without the main fix in this PR: ``` ================== WARNING: DATA RACE Read at 0x00c00119c168 by goroutine 54: crypto/internal/fips140/sha256.(*Digest).Write() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/crypto/internal/fips140/sha256/sha256.go:163 +0x40 bytes.(*Reader).WriteTo() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/bytes/reader.go:143 +0xec io.nopCloserWriterTo.WriteTo() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:702 +0xb8 io.(*nopCloserWriterTo).WriteTo() <autogenerated>:1 +0x20 io.copyBuffer() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:411 +0xa8 io.Copy() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:388 +0x1f8 github.com/apache/iceberg-go/catalog/rest.(*sessionTransport).RoundTrip() /Users/jhumphries/src/iceberg-go/catalog/rest/rest.go:227 +0x154 net/http.send() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:259 +0x66c net/http.(*Client).send() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:180 +0x104 net/http.(*Client).do() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:728 +0xdd4 net/http.(*Client).Do() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:587 +0x1ac github.com/apache/iceberg-go/catalog/rest.TestSigv4ConcurrentSigners.func3() /Users/jhumphries/src/iceberg-go/catalog/rest/rest_internal_test.go:212 +0x190 golang.org/x/sync/errgroup.(*Group).Go.func1() /Users/jhumphries/go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:78 +0x7c Previous write at 0x00c00119c168 by goroutine 50: crypto/internal/fips140/sha256.(*Digest).Write() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/crypto/internal/fips140/sha256/sha256.go:163 +0x54 bytes.(*Reader).WriteTo() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/bytes/reader.go:143 +0xec io.nopCloserWriterTo.WriteTo() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:702 +0xb8 io.(*nopCloserWriterTo).WriteTo() <autogenerated>:1 +0x20 io.copyBuffer() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:411 +0xa8 io.Copy() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/io/io.go:388 +0x1f8 github.com/apache/iceberg-go/catalog/rest.(*sessionTransport).RoundTrip() /Users/jhumphries/src/iceberg-go/catalog/rest/rest.go:227 +0x154 net/http.send() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:259 +0x66c net/http.(*Client).send() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:180 +0x104 net/http.(*Client).do() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:728 +0xdd4 net/http.(*Client).Do() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/net/http/client.go:587 +0x1ac github.com/apache/iceberg-go/catalog/rest.TestSigv4ConcurrentSigners.func3() /Users/jhumphries/src/iceberg-go/catalog/rest/rest_internal_test.go:212 +0x190 golang.org/x/sync/errgroup.(*Group).Go.func1() /Users/jhumphries/go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:78 +0x7c Goroutine 54 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /Users/jhumphries/go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:75 +0x10c github.com/apache/iceberg-go/catalog/rest.TestSigv4ConcurrentSigners() /Users/jhumphries/src/iceberg-go/catalog/rest/rest_internal_test.go:197 +0x78c testing.tRunner() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/testing/testing.go:1792 +0x180 testing.(*T).Run.gowrap1() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/testing/testing.go:1851 +0x40 Goroutine 50 (running) created at: golang.org/x/sync/errgroup.(*Group).Go() /Users/jhumphries/go/pkg/mod/golang.org/x/sync@v0.12.0/errgroup/errgroup.go:75 +0x10c github.com/apache/iceberg-go/catalog/rest.TestSigv4ConcurrentSigners() /Users/jhumphries/src/iceberg-go/catalog/rest/rest_internal_test.go:197 +0x78c testing.tRunner() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/testing/testing.go:1792 +0x180 testing.(*T).Run.gowrap1() /Users/jhumphries/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.darwin-arm64/src/testing/testing.go:1851 +0x40 ================== ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org