Skip to content

sql: fix data race in TestIntegrationCosmosDB#4282

Open
mmatczuk wants to merge 1 commit intomainfrom
mmt/sql-fix-data-race-in-testintegrationcosmosdb
Open

sql: fix data race in TestIntegrationCosmosDB#4282
mmatczuk wants to merge 1 commit intomainfrom
mmt/sql-fix-data-race-in-testintegrationcosmosdb

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

Skip TestIntegrationCosmosDB when running with the race detector.

The gocosmos driver depends on gjrc v0.2.2 which has a data race in
GjrcResponse.Body: it uses broken double-checked locking where the
outer nil check reads a shared field without the mutex while a
background goroutine (spawned eagerly by gjrc.buildResponse) writes
it under the mutex. This is a bug in the third-party library that
affects every gocosmos REST call and cannot be worked around.

gjrc v0.2.2 is the latest available version as of this commit.

Fixes CON-409

Skip TestIntegrationCosmosDB when running with the race detector.

The gocosmos driver depends on gjrc v0.2.2 which has a data race in
GjrcResponse.Body: it uses broken double-checked locking where the
outer nil check reads a shared field without the mutex while a
background goroutine (spawned eagerly by gjrc.buildResponse) writes
it under the mutex. This is a bug in the third-party library that
affects every gocosmos REST call and cannot be worked around.

gjrc v0.2.2 is the latest available version as of this commit.

Fixes CON-409
@@ -0,0 +1,19 @@
// Copyright 2024 Redpanda Data, Inc.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License header year: Both race_test.go and norace_test.go use Copyright 2024, but the current year is 2026. Per project Go patterns: "Use the current year."

Update the copyright year to 2026 in both new files.

@claude
Copy link
Copy Markdown

claude bot commented Apr 16, 2026

Commits
LGTM

Review
Clean change that skips the CosmosDB integration test under the race detector due to a known third-party data race in gjrc v0.2.2. The build-tag constant pair is a standard Go pattern and the implementation is correct.

  1. License header year: Both new files (race_test.go and norace_test.go) use Copyright 2024 instead of the current year 2026. Per project Go patterns: "Use the current year."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant