fix(ttx): close endorsement sessions on all return paths#1893
Open
AkramBitar wants to merge 1 commit into
Open
fix(ttx): close endorsement sessions on all return paths#1893AkramBitar wants to merge 1 commit into
AkramBitar wants to merge 1 commit into
Conversation
9deda07 to
bbf499d
Compare
Signed-off-by: AkramBitar <akram@il.ibm.com>
bbf499d to
4885897
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1637.
cleanupAuditonly ran after distribution succeeded, so a failure in a later phase (requestApprovalordistributeTxToParties) returned fromCollectEndorsementsView.Callearly and left the auditor session open — a repeatable leak of the FSC communication session on every error path (hence thesecuritylabel).Note: this does not hold any audit-DB enrollment-ID lock. That lock lives on the auditor node and is released by
Append'sdefer Release()before the auditor signature is sent back — i.e. beforerequestAuditreturns — so it is already released by the time any later phase can fail. The bug is strictly a leaked session handle.Fix: close all endorsement sessions in
CollectEndorsementsView.Callvia a deferred, idempotentcleanupSessions(safe on repeated calls and on any return path); add TTX unit tests.