Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
While we're here, I wonder if it's better to extend the whole try-finally block around this else-if branch? what if outstandingRpcs.get/remove fails? highly unlikely I guess so any 'leak' is trivial.
But what about the same problem around line 168 and 172? there's no try-finally around onSuccess, which could fail?
Do all of these messages really need to be release()-ed? meaning, should .release() happen in all branches?
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 wonder if it's better to extend the whole try-finally block around this else-if branch? what if outstandingRpcs.get/remove fails? highly unlikely I guess so any 'leak' is trivial., Yes , the outstandingRpcs.get/remove can not fail, so we should not try-finally block around this else-if branch here, which may Improve performance.But what about the same problem around line 168 and 172? there's no try-finally around onSuccess, which could fail?, i think we should also try-finally around onSuccess around line 168 and 172, do you think so ?Do all of these messages really need to be release()-ed? meaning, should .release() happen in all branches?,It should be released, although this scenario is not easy to happen.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 just wonder if it would be simpler to wrap a lot more in one big try-finally and release the thing in all cases?