BewareMyPower opened a new pull request, #23297:
URL: https://github.com/apache/pulsar/pull/23297

   ### Motivation
   
   https://github.com/apache/pulsar/pull/23230 tries to fix the issue that "the 
pulsar broker cannot catch the exception" caused by 
https://github.com/apache/pulsar/pull/22977. However, the fix is incorrect 
because even before https://github.com/apache/pulsar/pull/22977, the broker 
also wouldn't fail if the extensible load manager failed to start.
   
   It's destructive to have broker running with a failed load manager. Since 
`BrokerRegistry#unregister` will be called for failures, the issue broker will 
unregister itself from the metadata store and it could not be selected as the 
owner broker. Besides, all lookup requests sent to this broker will fail 
because the load manager is not started.
   
   ### Modifications
   
   - Revert https://github.com/apache/pulsar/pull/23230
   - Implement `failStarting` correctly:
     - If it has registered, just unregister the broker from the metadata store 
via `BrokerRegistry#close`  and swallow the exception.
     - Complete `initWaiter` with false to tell background threads to exit 
directly. Otherwise, methods like `playFollower` will swallow the exception 
from `initWaiter` and continue the loop.
     - Propagate the exception by wrapping checked exception 
`PulsarServerException` into a unchecked exception `CompletionException` and 
unwrap it in `PulsarService#start`'s catch block.
   - Add `LoadManagerFailFastTest` to verify the fail-fast behaviors and the 
broker will unregister itself from the metadata store.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: 


-- 
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