You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2017/12/11 15:29:03 UTC

[GitHub] ivankelly opened a new pull request #827: Race in PCBC connection if channel inactive before callback

ivankelly opened a new pull request #827: Race in PCBC connection if channel inactive before callback
URL: https://github.com/apache/bookkeeper/pull/827
 
 
   There's a race in PCBC where if the channel is errored before the
   connection callback occurs, the channel will hang around as a zombie
   forever.
   
   This caused a flake in
   TestDisableEnsembleChange#testRetryFailureBookie, but the problem
   itself could affect production code. This test hit it because it tries
   to reconnect in a tight loop as a bookie is booting.
   
   The error occurs because we only change state with channelInactive if
   the channelInactive occurred on the channel that matches the currently
   assigned this.channel. If the channel connects successfully, but
   channelInactive occurs before the connect callback runs, the channel
   will be closed, but the state will be transitioned to CONNECTED. No
   more events will occur on the channel, so it'll hang around forever,
   and all requests on the channel will timeout.
   
   The fix is to check that the channel is active before assigning it to
   this.channel and setting state to CONNECTED. If the channel is not
   active at this point, then the else clause of this block will run
   which closes the channel, and sets state to DISCONNECTED. In this
   case, the next request will trigger a new connection attempt.
   
   Descriptions of the changes in this PR:
   
   (PR description content here)...
   
   Master Issue: #<master-issue-number>
   
   > ---
   > Be sure to do all of 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 # or BOOKKEEPER-#>: Description of pull request`
   >     `e.g. Issue 123: Description ...`
   >     `e.g. BOOKKEEPER-1234: Description ...`
   > - [ ] Make sure tests pass via `mvn clean apache-rat:check install findbugs:check`.
   > - [ ] Replace `<Issue # or BOOKKEEPER-#>` in the title with the actual Issue/JIRA number.
   > 
   > ---
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services