Skip to content

Fix incorrect logs when a message failed to be decoded with the writer schema - #200

Merged
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/fix-error-msg
Feb 19, 2024
Merged

Fix incorrect logs when a message failed to be decoded with the writer schema#200
BewareMyPower merged 1 commit into
apache:mainfrom
BewareMyPower:bewaremypower/fix-error-msg

Conversation

@BewareMyPower

Copy link
Copy Markdown
Contributor

Motivation

See
https://github.com/apache/pulsar-client-python/blob/f9b2d168ae85f289d6ee043cd81791d569ba8844/pulsar/schema/schema_avro.py#L92C32-L92C69

When self._decode_bytes(msg.data(), writer_schema) failed, the error log is still Failed to get schema info, which is confusing.

Modifications

Modify the error message. Even if it failed at
self._get_writer_schema(topic, version), there would still be error logs from the C++ client.

@BewareMyPower BewareMyPower added the enhancement New feature or request label Feb 18, 2024
@BewareMyPower BewareMyPower added this to the 3.5.0 milestone Feb 18, 2024
@BewareMyPower BewareMyPower self-assigned this Feb 18, 2024
@BewareMyPower
BewareMyPower force-pushed the bewaremypower/fix-error-msg branch from e47605a to 2940c60 Compare February 18, 2024 05:38
@BewareMyPower

Copy link
Copy Markdown
Contributor Author

It seems the main branch is broken. I will fix it first.

@BewareMyPower
BewareMyPower marked this pull request as draft February 18, 2024 13:01
…r schema

### Motivation

See
https://github.com/apache/pulsar-client-python/blob/f9b2d168ae85f289d6ee043cd81791d569ba8844/pulsar/schema/schema_avro.py#L92C32-L92C69

When `self._decode_bytes(msg.data(), writer_schema)` failed, the error
log is still `Failed to get schema info`, which is confusing.

### Modifications

Modify the error message. Even if it failed at
`self._get_writer_schema(topic, version)`, there would still be error
logs from the C++ client.
@BewareMyPower
BewareMyPower force-pushed the bewaremypower/fix-error-msg branch from 2940c60 to 7882506 Compare February 19, 2024 02:14
@BewareMyPower
BewareMyPower marked this pull request as ready for review February 19, 2024 02:15
@BewareMyPower
BewareMyPower merged commit 48be179 into apache:main Feb 19, 2024
@BewareMyPower
BewareMyPower deleted the bewaremypower/fix-error-msg branch February 19, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

2 participants