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: data race in EachDBNodes #503

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

localvar
Copy link
Contributor

There are two data races in EachDBNodes:

  • the write of err is a data race and could cause a crash when reading the error.
  • the read/write of hasErr is a data race, though I don't think it will cause severe issues, its usage does not make much sense in a concurrent program.

other minor improvements:

  • don't log "retry execute command" before timeout
  • refactor to EachDBNodes and IsRetryErrorForPtView

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B
  • Test cases to be added
  • No code

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

There are two data races in `EachDBNodes`:
- the write of `err` is a data race and could cause a crash when reading the error.
- the read/write of `hasErr` is a data race, though I don't think it will cause severe issues, its usage does not make much sense in a concurrent program.

other minor improvements:
- don't log "retry execute command" before timeout
- refactor to `EachDBNodes` and `IsRetryErrorForPtView`

Signed-off-by: Bomin Zhang <localvar@hotmail.com>
@localvar localvar changed the title fix data race in EachDBNodes fix: data race in EachDBNodes Feb 28, 2024
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 38.70968% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 74.71%. Comparing base (222f626) to head (735a2c9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #503   +/-   ##
=======================================
  Coverage   74.71%   74.71%           
=======================================
  Files         558      558           
  Lines      118219   118212    -7     
=======================================
- Hits        88324    88319    -5     
+ Misses      24381    24379    -2     
  Partials     5514     5514           

@xiangyu5632
Copy link
Member

@fx408 review required, please

coordinator/meta_executor.go Show resolved Hide resolved
@xiangyu5632
Copy link
Member

tks @localvar

@xiangyu5632 xiangyu5632 merged commit ef157bd into openGemini:main Feb 29, 2024
8 checks passed
@localvar localvar deleted the fix-each-db-nodes branch March 1, 2024 03:48
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