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

Use a std::mutex to protect registered_callbacks_. #331

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

sighingnow
Copy link
Member

What do these changes do?

The callback data structures cannot be modified concurrently.

Related issue number

Fixes #330.

Signed-off-by: Tao He <sighingnow@gmail.com>
Signed-off-by: Tao He <sighingnow@gmail.com>
@codecov
Copy link

codecov bot commented Jun 21, 2021

Codecov Report

Merging #331 (8db7d21) into main (9091175) will decrease coverage by 0.55%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
- Coverage   74.30%   73.74%   -0.56%     
==========================================
  Files          62       62              
  Lines        5156     5192      +36     
==========================================
- Hits         3831     3829       -2     
- Misses       1325     1363      +38     
Impacted Files Coverage Δ
src/server/services/etcd_meta_service.cc 78.43% <90.00%> (+0.14%) ⬆️
src/server/services/etcd_meta_service.h 92.30% <100.00%> (-0.29%) ⬇️
src/server/async/socket_server.cc 72.10% <0.00%> (-2.60%) ⬇️
src/server/util/meta_tree.cc 80.72% <0.00%> (-1.59%) ⬇️
src/server/server/vineyard_server.cc 72.20% <0.00%> (-1.40%) ⬇️
src/server/memory/memory.cc 72.77% <0.00%> (-1.24%) ⬇️
src/server/util/etcd_launcher.cc 77.77% <0.00%> (-0.68%) ⬇️
src/server/memory/stream_store.cc 62.50% <0.00%> (-0.53%) ⬇️
src/server/services/meta_service.h 79.94% <0.00%> (-0.26%) ⬇️

Copy link
Collaborator

@andydiwenzhu andydiwenzhu left a comment

Choose a reason for hiding this comment

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

LGTM. Nice fix!

@sighingnow sighingnow merged commit 6e9c9cc into v6d-io:main Jun 21, 2021
@sighingnow sighingnow deleted the ht/crash branch August 19, 2021 08:58
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.

Crash and race condition in etcd_meta_service
2 participants