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 #2177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: data race #2177

wants to merge 1 commit into from

Conversation

alpha-baby
Copy link
Member

Issues associated with this PR

#2176

Solutions

You should show your solutions about the issues in your PR, including the overall solutions, details and the changes. At this time, Chinese is allowed to describe these.

UT result

Unit Test is needed if the code is changed, your unit test should cover boundary cases, corner cases, and some exceptional cases. And you need to show the UT result.

Benchmark

If your code involves the processing of every request, you should give the Benchmark Result.

Code Style

  • Make sure Goimports has run
  • Show Golint result

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 60.48% // Head: 60.40% // Decreases project coverage by -0.08% ⚠️

Coverage data is based on head (7609f3c) compared to base (f415c9a).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 7609f3c differs from pull request most recent head 6acb81f. Consider uploading reports for the commit 6acb81f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2177      +/-   ##
==========================================
- Coverage   60.48%   60.40%   -0.09%     
==========================================
  Files         417      417              
  Lines       36598    36602       +4     
==========================================
- Hits        22136    22108      -28     
- Misses      12288    12313      +25     
- Partials     2174     2181       +7     
Impacted Files Coverage Δ
pkg/upstream/cluster/health.go 82.60% <100.00%> (+3.66%) ⬆️
...ream/faulttolerance/regulator/default_regulator.go 81.81% <0.00%> (-18.19%) ⬇️
...aulttolerance/regulator/invocation_stat_factory.go 85.00% <0.00%> (-15.00%) ⬇️
pkg/stream/stream.go 46.66% <0.00%> (-13.34%) ⬇️
pkg/stream/xprotocol/connpool_pingpong.go 50.00% <0.00%> (-12.11%) ⬇️
...ream/faulttolerance/regulator/default_work_pool.go 88.63% <0.00%> (-4.55%) ⬇️
pkg/stream/xprotocol/conn.go 40.43% <0.00%> (-1.10%) ⬇️
pkg/module/http2/server.go 81.77% <0.00%> (-0.15%) ⬇️
pkg/module/http2/transport.go 78.91% <0.00%> (+0.28%) ⬆️
pkg/mtls/sds/subscriber.go 78.43% <0.00%> (+3.92%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@doujiang24
Copy link
Member

LGTM. But one question, why there are two health checkers updating the flags concurrency?
From my common sense, health checkers in concurrency for a single host is not reasonable.

@alpha-baby
Copy link
Member Author

LGTM. But one question, why there are two health checkers updating the flags concurrency? From my common sense, health checkers in concurrency for a single host is not reasonable.

Maybe host object is the same one, but their address is the same one.

example:

there is two host that address is same. it's in two differet cluster and heathyChcker, so will currently update it's flag.
Of course, the probability of data race is very small.

@doujiang24
Copy link
Member

there is two host that address is same. it's in two differet cluster and heathyChcker, so will currently update it's flag. Of course, the probability of data race is very small.

two host objects that have the same address, still are two host objects? there won't be race?
The race could happen, when the same host is shared in two different clusters, right? Could it be possible? @nejisama

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

Successfully merging this pull request may close these issues.

None yet

2 participants