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

INDY-1274: Fix for logging #675

Merged
merged 8 commits into from
May 16, 2018
Merged

Conversation

ArtObr
Copy link
Contributor

@ArtObr ArtObr commented May 14, 2018

Signed-off-by: ArtObr artemobruchnikov@gmail.com

Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
Signed-off-by: ArtObr <artemobruchnikov@gmail.com>
@@ -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 = []
Copy link
Contributor

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?

Copy link
Contributor Author

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>
@ArtObr
Copy link
Contributor Author

ArtObr commented May 15, 2018

Test this please

if over_count > 0:
for i in range(over_count):
messaged = self._messaged_reqs.popleft()
logger.info('Consensus for ReqId: {} was not achieved. '
Copy link
Contributor

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>
else:
logger.info('Consensus for ReqId: {} was achieved'
.format(messaged[0]))
self.requestTracker._messaged_reqs = new_messaged
Copy link
Contributor

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.

self.instance_count = instance_count
self._requests = {}
self._messaged_reqs = deque()
Copy link
Contributor

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>
@ArtObr
Copy link
Contributor Author

ArtObr commented May 16, 2018

Test this please

@ashcherbakov ashcherbakov merged commit df1aba8 into hyperledger:master May 16, 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.

None yet

2 participants