Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Avoid printing log for IncompatibleSchemaException in ServerCnx #23938

Merged

Conversation

RobertIndie
Copy link
Member

Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled

This error can be reported to the client and not need to print it in the broker.

Modifications

  • Avoid printing log for IncompatibleSchemaException in ServerCnx

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@RobertIndie RobertIndie added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages ready-to-test release/3.0.10 release/3.3.5 release/4.0.3 labels Feb 6, 2025
@RobertIndie RobertIndie added this to the 4.1.0 milestone Feb 6, 2025
@RobertIndie RobertIndie self-assigned this Feb 6, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 6, 2025
@RobertIndie RobertIndie merged commit 3c0bbee into apache:master Feb 7, 2025
53 of 56 checks passed
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…in ServerCnx (#23938)

### Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

```
ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled
```

This error can be reported to the client and not need to print it in the broker.

### Modifications

- Avoid printing log for IncompatibleSchemaException in ServerCnx

(cherry picked from commit 3c0bbee)
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…in ServerCnx (#23938)

### Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

```
ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled
```

This error can be reported to the client and not need to print it in the broker.

### Modifications

- Avoid printing log for IncompatibleSchemaException in ServerCnx

(cherry picked from commit 3c0bbee)
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…in ServerCnx (#23938)

### Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

```
ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled
```

This error can be reported to the client and not need to print it in the broker.

### Modifications

- Avoid printing log for IncompatibleSchemaException in ServerCnx

(cherry picked from commit 3c0bbee)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Feb 10, 2025
…in ServerCnx (apache#23938)

### Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

```
ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled
```

This error can be reported to the client and not need to print it in the broker.

### Modifications

- Avoid printing log for IncompatibleSchemaException in ServerCnx

(cherry picked from commit 3c0bbee)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
…in ServerCnx (apache#23938)

### Motivation

If the producer is created with some schema error, the broker will print many error logs like this:

```
ERROR org.apache.pulsar.broker.service.ServerCnx - Try add schema failed, remote address xxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.schema.exceptions.IncompatibleSchemaException: Producers cannot connect or send message without a schema to topics with a schemawhen SchemaValidationEnforced is enabled
```

This error can be reported to the client and not need to print it in the broker.

### Modifications

- Avoid printing log for IncompatibleSchemaException in ServerCnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.0 cherry-picked/branch-3.3 cherry-picked/branch-4.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.10 release/3.3.5 release/4.0.3 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants