repeat registration when unload a bundle
Fixes #12165
Motivation
The bundle unloading of one producer or consumer will not affect other prodcers or consumers which belong to the same client and share the same connection.
If the bundle is unload when lookup, the server will send back error code ServiceNotReady. And the the client will close the connection in checkServerError.
private void checkServerError(ServerError error, String errMsg) {
if (ServerError.ServiceNotReady.equals(error)) {
log.error("{} Close connection because received internal-server error {}", ctx.channel(), errMsg);
ctx.close();
} else if (ServerError.TooManyRequests.equals(error)) {
incrementRejectsAndMaybeClose();
}
}
The other proudcers or consumers will be affected as they share the some connection. The request of the connection will be dropped and lookup.
Modifications
Replace the error code ServiceNotReady with ServerMetadata. The client will not close the connection, and other proudcers or consumers will not be affected.
Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- return error code ServerMetadata when bundle is unloaded
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?
-
[ ]
doc-required(If you need help on updating docs, create a doc issue)
-
[x]
no-need-doc(Please explain why)
-
[ ]
doc(If this PR contains doc changes)
/pulsarbot run-failure-checks
/pulsarbot run-failure-checks
/pulsarbot run-failure-checks
@codelipenghui please take a look, thanks~
/pulsarbot run-failure-checks
/pulsarbot run-failure-checks
/pulsarbot run-failure-checks
The pr had no activity for 30 days, mark with Stale label.
The pr had no activity for 30 days, mark with Stale label.