pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[improve][broker]reduce lookup response meta exception while bundle is being unloaded

Open HQebupt opened this issue 3 years ago • 2 comments

Fixed https://github.com/apache/pulsar/issues/12165

Motivation

see https://github.com/apache/pulsar/issues/12165 The bundle unloading of one producer or consumer will not affect other producers and consumers which belong to the same client and share the same connection.

If the bundle is being unloaded when there is a lookup request coming, the server will send back error code ServiceNotReady. And the client will close the connection in checkServerError. https://github.com/apache/pulsar/blob/5c09d536304e5873c4e1ceeb8353a1150b5d61f4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java#L1123-L1130

The other producers and consumers will be affected due to they share the same connection. The requests of the connection will be drop.

Modifications

Add the error code ServiceNotReady with ServerMetadata. The client will not close the connection, and other producers and consumers will not be affected when the bundle is being unloaded.

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

HQebupt avatar Aug 05 '22 01:08 HQebupt

/pulsarbot run-failure-checks

HQebupt avatar Aug 05 '22 07:08 HQebupt

/pulsarbot run-failure-checks

HQebupt avatar Aug 07 '22 09:08 HQebupt

The pr had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Sep 08 '22 02:09 github-actions[bot]