Skip to content

Make errorCode of InsertTimeOutOfBoundsFault consistent with others#14495

Merged
zachjsh merged 3 commits intoapache:masterfrom
zachjsh:fix-msq-fault-codes
Jul 13, 2023
Merged

Make errorCode of InsertTimeOutOfBoundsFault consistent with others#14495
zachjsh merged 3 commits intoapache:masterfrom
zachjsh:fix-msq-fault-codes

Conversation

@zachjsh
Copy link
Copy Markdown
Contributor

@zachjsh zachjsh commented Jun 28, 2023

The errorCode of this fault when serialized over the wire was being set to the name of the class InsertTimeOutOfBoundsFault instead of the CODE InsertTimeOutOfBounds. All other faults' errorCodes are serialized as the respective Fault's code, so making consistent here as well. I checked all existing faults at the moment, and this was the only one I found to be inconsistent.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

The errorCode of this fault when serialized over the wire was being
set to the name of the class `InsertTimeOutOfBoundsFault` instead of
the CODE `InsertTimeOutOfBounds`. All other faults' errorCodes are
serialized as the respective Fault's code, so making consistent here
as well.
Copy link
Copy Markdown
Contributor

@amaechler amaechler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks @zachjsh.

@zachjsh
Copy link
Copy Markdown
Contributor Author

zachjsh commented Jun 28, 2023

Nice catch, thanks @zachjsh.

image


import java.util.Objects;

@JsonTypeName(InsertTimeOutOfBoundsFault.CODE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any unit test that tests the serialization/deserialization of this class's wire format?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes in org.apache.druid.msq.indexing.error.MSQFaultSerdeTest

@zachjsh zachjsh merged commit 589aac8 into apache:master Jul 13, 2023
@zachjsh zachjsh deleted the fix-msq-fault-codes branch July 13, 2023 18:34
sergioferragut pushed a commit to sergioferragut/druid that referenced this pull request Jul 21, 2023
…pache#14495)

The errorCode of this fault when serialized over the wire was being
set to the name of the class `InsertTimeOutOfBoundsFault` instead of
the CODE `InsertTimeOutOfBounds`. All other faults' errorCodes are
serialized as the respective Fault's code, so making consistent here
as well.
@LakshSingla LakshSingla added this to the 28.0 milestone Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants