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

chore(dot/network): replace sync.Map with map+mutex #2284

Merged
merged 2 commits into from
Mar 10, 2022

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Feb 9, 2022

Changes

  • Add peersData struct holding 3 mutex protected maps:
    • inbound
    • outbound
    • mutexes
  • Add helping methods on peersData:
    • countOutboundStreams
    • countInboundStreams

Tests

Issues

Primary Reviewer

@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #2284 (fc4c75c) into development (2086496) will increase coverage by 2.01%.
The diff coverage is 76.76%.

❗ Current head fc4c75c differs from pull request most recent head 90b9572. Consider uploading reports for the commit 90b9572 to get more accurate results

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #2284      +/-   ##
===============================================
+ Coverage        58.04%   60.05%   +2.01%     
===============================================
  Files              213      212       -1     
  Lines            27992    27779     -213     
===============================================
+ Hits             16247    16683     +436     
+ Misses           10109     9370     -739     
- Partials          1636     1726      +90     
Flag Coverage Δ
unit-tests 60.05% <76.76%> (+2.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dot/network/service.go 57.30% <50.00%> (+1.42%) ⬆️
dot/network/peersdata.go 72.41% <72.41%> (ø)
dot/network/notifications.go 68.26% <89.65%> (-1.33%) ⬇️
dot/network/block_announce.go 59.32% <100.00%> (-5.09%) ⬇️
dot/network/inbound.go 92.98% <100.00%> (-7.02%) ⬇️
dot/core/service.go 0.00% <0.00%> (-33.51%) ⬇️
dot/state/block_notify.go 81.90% <0.00%> (-8.58%) ⬇️
dot/types/header.go 70.68% <0.00%> (-4.32%) ⬇️
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2086496...90b9572. Read the comment docs.

dot/network/peersdata.go Outdated Show resolved Hide resolved
Copy link
Contributor

@noot noot left a comment

Choose a reason for hiding this comment

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

looks good, minor comment only

@qdm12 qdm12 force-pushed the qdm12-dot-network-syncmap branch from 05f94d8 to 90b9572 Compare March 10, 2022 14:16
@qdm12 qdm12 merged commit 5843324 into development Mar 10, 2022
@qdm12 qdm12 deleted the qdm12-dot-network-syncmap branch March 10, 2022 15:25
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