zhiheng123 opened a new pull request, #4392:
URL: https://github.com/apache/bookkeeper/pull/4392

   …4293)
   
   This addresses the remaining gaps of #4289 in handling ByteBuf 
retain/release. This PR will also address the concern about NioBuffer lifecycle 
brought up in the review of the original PR review: 
https://github.com/apache/bookkeeper/issues/791#issuecomment-383237059 .
   
   This PR fixes several problems:
   * ByteString buffer lifecycle in client, follows ByteBufList lifecycle
   * ByteBufList lifecycle, moved to write promise
   * Calling of write promises in AuthHandler which buffers messages while 
authentication is in progress. It was ignoring the promises.
   
   - add 2 callback parameters to writeAndFlush: cleanupActionFailedBeforeWrite 
and cleanupActionAfterWrite
     - use these callback actions for proper cleanup
   - extract a utility class ByteStringUtil for wrapping ByteBufList or ByteBuf 
as concatenated zero copy ByteString
   - properly handle releasing of ByteBufList in the write promise
   - properly handle calling promises that are buffered while authentication is 
in progress
   
   Descriptions of the changes in this PR:
   
   <!-- Either this PR fixes an issue, -->
   
   Fix #xyz
   
   <!-- or this PR is one task of an issue -->
   
   Main Issue: #xyz
   
   <!-- If the PR belongs to a BP, please add the BP link here -->
   
   BP: #xyz
   
   ### Motivation
   
   (Explain: why you're making that change, what is the problem you're trying 
to solve)
   
   ### Changes
   
   (Describe: what changes you have made)
   
   > ---
   > In order to uphold a high standard for quality for code contributions, 
Apache BookKeeper runs various precommit
   > checks for pull requests. A pull request can only be merged when it passes 
precommit checks.
   >
   > ---
   > Be sure to do all the following to help us incorporate your contribution
   > quickly and easily:
   >
   > If this PR is a BookKeeper Proposal (BP):
   >
   > - [ ] Make sure the PR title is formatted like:
   >     `<BP-#>: Description of bookkeeper proposal`
   >     `e.g. BP-1: 64 bits ledger is support`
   > - [ ] Attach the master issue link in the description of this PR.
   > - [ ] Attach the google doc link if the BP is written in Google Doc.
   >
   > Otherwise:
   > 
   > - [ ] Make sure the PR title is formatted like:
   >     `<Issue #>: Description of pull request`
   >     `e.g. Issue 123: Description ...`
   > - [ ] Make sure tests pass via `mvn clean apache-rat:check install 
spotbugs:check`.
   > - [ ] Replace `<Issue #>` in the title with the actual Issue number.
   > 
   > ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to