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

[C++] Add detail logs for schema related messages #9544

Merged

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Feb 9, 2021

Motivation

If broker failed to parse the schema, the logs of C++/Python client is poor because when C++ client handles the Error response, it doesn't print the message field that is filled by broker. On the other hand, if the InvalidSchemaDataException is thrown by StructSchemaDataValidator#throwInvalidSchemaDataException, the detail error message will be written to the exception's cause. The String that getMessage() returns is not enough

Modifications

  • When tryAddSchema failed, add the exception cause's message to the error message that's sent to client.
  • Print Error response's message field to logs.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage. Take #9483 (which is to be fixed) as the example, before this PR, the client side's log is like

Received error response from server: IncompatibleSchema -- req_id: 0

After this PR, the client side's log will be

Received error response from server: IncompatibleSchema (Invalid schema definition data for AVRO schema caused by org.apache.avro.SchemaParseException: Undefined name: "array") -- req_id: 0

@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

@sijie sijie added this to the 2.8.0 milestone Feb 9, 2021
@sijie sijie added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Feb 9, 2021
@BewareMyPower BewareMyPower force-pushed the bewaremypower/schema-logs-enhancement branch from 03c6e8d to 7da01af Compare February 10, 2021 03:18
@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

@sijie sijie merged commit d2d5fb6 into apache:master Feb 11, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/schema-logs-enhancement branch February 11, 2021 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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