pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

repeat registration when unload a bundle

Open suiyuzeng opened this issue 4 years ago • 9 comments

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)

suiyuzeng avatar Dec 28 '21 10:12 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Dec 29 '21 03:12 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Dec 30 '21 02:12 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Dec 30 '21 10:12 suiyuzeng

@codelipenghui please take a look, thanks~

suiyuzeng avatar Dec 31 '21 02:12 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Jan 10 '22 02:01 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Jan 11 '22 02:01 suiyuzeng

/pulsarbot run-failure-checks

suiyuzeng avatar Jan 13 '22 07:01 suiyuzeng

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

github-actions[bot] avatar Feb 26 '22 01:02 github-actions[bot]

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

github-actions[bot] avatar May 29 '22 02:05 github-actions[bot]