HQebupt opened a new pull request, #17315: URL: https://github.com/apache/pulsar/pull/17315
### Motivation Inspired by #17085 When the leader broker is closing, and the client will reconnect and redo lookup, resulting in unexpected results. > @codelipenghui > Looks like we also need to check other cases (e.g. handleConnect) > If the broker is shutting down, we should also prevent new connections. Therefore, it is necessary to check the status of the broker when handling requests, including connect\lookup\partitioned metadata. The following is the interaction workflow between consumer and broker. ``` Consumer -> Broker: CONNECT Broker -> Consumer: CONNECTED Consumer -> Broker: PARTITIONED_METADATA Broker -> Consumer: PARTITIONED_METADATA_RESPONSE Consumer -> Broker: LOOKUP Broker -> Consumer: LOOKUP_RESPONSE Consumer -> Broker: SUBSCIBE Broker -> Consumer: SUCCESS Consumer -> Broker: FLOW Broker -> Consumer: MESSAGE Consumer - Broker: ACK ``` The following screenshot is the interaction workflow between producer and broker. <img width="510" alt="image" src="https://user-images.githubusercontent.com/4970972/187061264-36cd2a06-0414-4e5e-a097-05af07eb6c39.png"> ### Modifications - Check Pulsar Service state when handle connection and partitioned metadata request. ### Verifying this change - [x] Make sure that the change passes the CI checks. This change is a trivial rework / code cleanup without any test coverage. ### Does this pull request potentially affect one of the following parts: If `yes` was chosen, please highlight the changes - Dependencies (does it add or upgrade a dependency): (no) - The public API: (no) - The schema: (no) - The default values of configurations: (no) - The wire protocol: (no) - The rest endpoints: (no) - The admin cli options: (no) - Anything that affects deployment: (no) ### Documentation Check the box below and label this PR (if you have committer privilege). Need to update docs? - [x] `doc-not-needed` -- 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]
