Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: different concreate types still cause panic #4597

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

kevwan
Copy link
Contributor

@kevwan kevwan commented Jan 23, 2025

fix #4594

@kevwan kevwan force-pushed the fix/httpx-validator branch from 300ece4 to 8b518f8 Compare January 23, 2025 15:18
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.54%. Comparing base (8690859) to head (c52af3a).
Report is 232 commits behind head on master.

Additional details and impacted files
Files with missing lines Coverage Δ
rest/httpx/requests.go 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

@kevwan kevwan force-pushed the fix/httpx-validator branch from 8b518f8 to c52af3a Compare January 25, 2025 10:20
Copy link
Contributor Author

@kevwan kevwan left a comment

Choose a reason for hiding this comment

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

Review Summary:

  • Thread Safety Improvement: The changes replace sync/atomic with sync and use sync.RWMutex to ensure thread-safe access and modification of the validator.
  • Test Case Addition: A new test case TestSetValidatorTwice has been added to verify that setting the validator multiple times does not lead to a panic, addressing the issue of storing inconsistently typed values into atomic.Value.

@kevwan kevwan merged commit 44504e8 into zeromicro:master Jan 25, 2025
6 checks passed
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.

rest/httpx.SetValidator might panic
1 participant