-
Notifications
You must be signed in to change notification settings - Fork 366
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
INDY-1274: Fix for logging #675
Conversation
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
plenum/server/monitor.py
Outdated
@@ -55,6 +55,7 @@ def is_ordered_by_all(self): | |||
def __init__(self, instance_count): | |||
self.instance_count = instance_count | |||
self._requests = {} | |||
self.messaged_reqs = [] |
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.
Isn't it a source of a possible memory leak?
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.
Yes, i missed this out. Probably we can remove txns, that was unordered for too long.
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Test this please |
plenum/server/monitor.py
Outdated
if over_count > 0: | ||
for i in range(over_count): | ||
messaged = self._messaged_reqs.popleft() | ||
logger.info('Consensus for ReqId: {} was not achieved. ' |
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.
I think it needs to be DEBUG level
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
plenum/server/monitor.py
Outdated
else: | ||
logger.info('Consensus for ReqId: {} was achieved' | ||
.format(messaged[0])) | ||
self.requestTracker._messaged_reqs = new_messaged |
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.
Why do we need to re-create the list every time? Why don't just remove the message from _messaged_reqs
if we ordered it here? I think probability that previously unordered request is finally ordered is not so high, so it will be called relatively rare.
plenum/server/monitor.py
Outdated
self.instance_count = instance_count | ||
self._requests = {} | ||
self._messaged_reqs = deque() |
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 add a comment what _messaged_reqs
is or maybe rename it to something like _unordered_req
?
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Test this please |
Signed-off-by: ArtObr artemobruchnikov@gmail.com