suiyuzeng opened a new pull request #13537:
URL: https://github.com/apache/pulsar/pull/13537
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)
--
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]