-
Notifications
You must be signed in to change notification settings - Fork 297
Conversation
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Cool PR name :) |
libs/common/subscription_watcher.hpp
Outdated
std::lock_guard<std::mutex> lock{this->mutex_}; | ||
auto it = subscriptions_.begin(); | ||
while (it != subscriptions_.end()) { | ||
if (++it->second.counter >= kMaxCounterValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that will perform increment, even if the condition isn't true. That might have some undesirable edge-case issues, e.g if kMaxCounterValue == UINT8_MAX
Signed-off-by: Akvinikym <anarant12@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix small issues
|
||
std::mutex round_update_mutex_; | ||
std::shared_ptr<iroha::network::ConsensusGate> consensus_gate_; | ||
const int kMaximumRoundsWithoutUpdate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a constant since you set it in a constructor, so usual naming should be used here.
round_notifier.get_subscriber().on_next(iroha::consensus::BlockReject{}); | ||
|
||
// if this join happens, this means that stream is off | ||
t.join(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will never terminate if the code it tests is broken. Please add a timeout, after which the test has failed.
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
Signed-off-by: Akvinikym <anarant12@gmail.com>
IR-130
Description of the Change
Previously, if status of the transaction was not updated for some time, status stream, on which client was subscribed, went off. This is a correct behaviour, but instead of waiting for time, Iroha should wait for some rounds to complete, and this is what this PR does.
Benefits
More correct behaviour.
Possible Drawbacks
None.