Skip to content

fix: data race issue due to mutating http.DefaultTransport#1915

Merged
Prashansa-K merged 4 commits into
mainfrom
fix/data-race-issue-konnect
Mar 6, 2026
Merged

fix: data race issue due to mutating http.DefaultTransport#1915
Prashansa-K merged 4 commits into
mainfrom
fix/data-race-issue-konnect

Conversation

@Prashansa-K
Copy link
Copy Markdown
Contributor

@Prashansa-K Prashansa-K commented Mar 5, 2026

Ref: Kong/go-database-reconciler#392
Konnect tests often require re-runs due to data races' based failures.
These races occur more often if we add more tests for konnect.
These data races are unpredictable due to the nature of golang's internal modules.
The change in GDR removes the main cause of the data race.

This PR aims to make development velocity faster by avoiding such data races in
Konnect or Kong gateway.

Added some corrections for konnect tests due to schema changes.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 22.50000% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.54%. Comparing base (2417e30) to head (cd67570).

Files with missing lines Patch % Lines
cmd/common_konnect.go 0.00% 9 Missing ⚠️
tests/integration/test_utils.go 0.00% 8 Missing ⚠️
cmd/konnect_dump.go 0.00% 5 Missing ⚠️
cmd/common.go 69.23% 4 Missing ⚠️
cmd/gateway_ping.go 0.00% 4 Missing ⚠️
cmd/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1915      +/-   ##
==========================================
- Coverage   33.70%   33.54%   -0.17%     
==========================================
  Files          76       76              
  Lines        6682     6711      +29     
==========================================
- Hits         2252     2251       -1     
- Misses       4251     4280      +29     
- Partials      179      180       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Prashansa-K Prashansa-K force-pushed the fix/data-race-issue-konnect branch from 43d2d0e to c8cd262 Compare March 6, 2026 08:27
Comment thread cmd/gateway_ping.go
}
// get Konnect client
httpClient, err := utils.HTTPClientWithTLSConfig(rootConfig.TLSConfig)
httpClient, err := utils.HTTPClientWithOpts(utils.HTTPClientOptions{
Copy link
Copy Markdown
Contributor Author

@Prashansa-K Prashansa-K Mar 6, 2026

Choose a reason for hiding this comment

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

Switched to the new method so that timeout field can be same as the one passed by the users in the config. If nothing is passed, default timeout = 10s is set.

Comment thread cmd/konnect_dump.go
Args: validateNoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
httpClient := utils.HTTPClient()
httpClient, err := utils.HTTPClientWithOpts(utils.HTTPClientOptions{
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bunch of these functions are not used anymore or are in alpha state and deprecated. Not dealing with removal as a part of this PR.

DECK_KONNECT_PASSWORD : ${{ secrets.DECK_KONNECT_PASSWORD }}
DECK_KONNECT_ADDR : ${{ secrets.DECK_KONNECT_ADDR }}
DECK_KONNECT_TOKEN : ${{ secrets.DECK_KONNECT_TOKEN }}
DECK_TIMEOUT: ${{ vars.DECK_TIMEOUT || '60' }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

10s timeout for deck commands is often not enough for konnect-dev APIs. Thus, increased them to 60 here.

harshadixit12
harshadixit12 previously approved these changes Mar 6, 2026
@Prashansa-K Prashansa-K merged commit 7f38d14 into main Mar 6, 2026
40 checks passed
@Prashansa-K Prashansa-K deleted the fix/data-race-issue-konnect branch March 6, 2026 10:33
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.

3 participants