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

Network queues #606

Merged
merged 4 commits into from
Jan 20, 2020
Merged

Network queues #606

merged 4 commits into from
Jan 20, 2020

Conversation

roman-khimov
Copy link
Member

Problem

#590 and some other bugs.

Solution

This is an initial version that just solves the #590. We need to expand it later with more complex gossiping logic (we have broadcasting instead of that now everywhere).

pkg/network/tcp_peer.go Outdated Show resolved Hide resolved
pkg/network/tcp_peer.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 17, 2020

Codecov Report

Merging #606 into master will increase coverage by 0.13%.
The diff coverage is 15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #606      +/-   ##
==========================================
+ Coverage   63.42%   63.56%   +0.13%     
==========================================
  Files         125      122       -3     
  Lines       10251    10125     -126     
==========================================
- Hits         6502     6436      -66     
+ Misses       3450     3384      -66     
- Partials      299      305       +6
Impacted Files Coverage Δ
pkg/network/tcp_transport.go 0% <0%> (ø) ⬆️
pkg/network/tcp_peer.go 39.02% <17.52%> (-19.23%) ⬇️
pkg/network/server.go 12.63% <3.12%> (+1.57%) ⬆️
pkg/network/message.go 53.1% <42.85%> (+20.24%) ⬆️
pkg/wallet/account.go 88.23% <0%> (-4.22%) ⬇️
pkg/crypto/keys/private_key.go 73.91% <0%> (-2.21%) ⬇️
pkg/rpc/txBuilder.go 38.34% <0%> (-0.61%) ⬇️
pkg/wallet/wallet.go 75.55% <0%> (-0.45%) ⬇️
... and 25 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 32213b1...0ba6b2a. Read the comment docs.

pkg/network/peer.go Outdated Show resolved Hide resolved
pkg/network/tcp_peer.go Show resolved Hide resolved
pkg/network/tcp_peer.go Outdated Show resolved Hide resolved
pkg/network/tcp_peer.go Outdated Show resolved Hide resolved
@fyrchik
Copy link
Contributor

fyrchik commented Jan 19, 2020

@roman-khimov @im-kulikov Have you already done benchmarks with this version?

@im-kulikov
Copy link
Contributor

@fyrchik nope

@roman-khimov
Copy link
Member Author

To be fair, I don't think it will change benchmark results a lot, but who knows.

It should always signal to the server, not duplicating this send and not
missing it like it happened in the Server.run().
It's internal state of the peer that no one should care about.
Two queues for high-priority and ordinary messages. Fixes #590. These queues
are deliberately made small to avoid buffer bloat problem, there is gonna be
another queueing layer above them to compensate for that. The queues are
designed to be synchronous in enqueueing, async capabilities are to be added
layer above later.
@roman-khimov
Copy link
Member Author

OK, I've pushed just the rebased original patches here, so I think they're reviewed enough already to merge (and to fix #590). Newer patches (and I have a queue of them already) are gonna be pushed to the new branch for proper review.

@roman-khimov roman-khimov merged commit 2348a46 into master Jan 20, 2020
@roman-khimov roman-khimov deleted the network-queues branch January 20, 2020 16:36
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.

4 participants