Skip to content

Protocol upgrade pipelining#47

Merged
bedeho merged 12 commits intoJoystreamClassic:developmentfrom
mnaamani:protocol-upgrade-pipelining
Feb 2, 2018
Merged

Protocol upgrade pipelining#47
bedeho merged 12 commits intoJoystreamClassic:developmentfrom
mnaamani:protocol-upgrade-pipelining

Conversation

@mnaamani
Copy link
Copy Markdown
Contributor

Updates to work with new changes in protocol_session JoystreamClassic/protocol_session-cpp#27

Copy link
Copy Markdown

@bedeho bedeho left a comment

Choose a reason for hiding this comment

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

I am quite happy to approve really, but perhaps we can just quickly discuss some of these issuses tomorrow.

Comment thread sources/include/extension/Common.hpp Outdated
namespace extension {

std::chrono::duration<double>
calculatePieceTimeout(const double & pieceLengthBytes,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should not really be a public function

// Remove peer
std::clog << "Dropping Peer: (incompatible protocol vesrion)" << std::endl;
libtorrent::error_code ec;
drop(ec);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this is a bit strict, its not clear that we cannot hold a connection open for normal bittorrent/DHT traffic. It could also be useful for the extension user to understand how often and what peers are using incompatible protocol version. To this end, one could introduce a new enum value in BEPSupportStatus which reflects an incompatible version explicitly. For now though, this is good enough I think, so at best making an issue out of this could be interesting, and perhaps marking it with "good first issue" or help wanted.

Comment thread sources/src/TorrentPlugin.cpp Outdated
_session.tick();
}

if(_session.mode() == protocol_session::SessionMode::buying &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this policing not happening inside protocol_session ? Actually, even the mode guard could be inside of that same routine?


std::clog << "Failed reading piece" << alert->piece << "for" << libtorrent::print_address(endPoint.address()).c_str() << std::endl;
assert(false);
std::clog << "Failed reading piece" << alert->piece << std::endl;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess in principle this could actually fail, and we should handle it more gracefully`? Why not add an issue for this, no need to get into any analysis at this point though.

auto peerPlugin = peer(peerId);
auto endPoint = peerPlugin->endPoint();
// Remove registeration
_outstandingLoadPieceForBuyers.erase(it);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps I am missing something, but are we no longer telling session about peerId of pieceread? how is that possible?

@bedeho bedeho merged commit a0cd159 into JoystreamClassic:development Feb 2, 2018
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.

2 participants