Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3426

Improve protocol type errors when invalid sizes are received

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0.0
    • Fix Version/s: 0.10.0.0
    • Component/s: None
    • Labels:
      None

      Description

      We currently don't perform much validation on the size value read by the protocol types. This means that we end up throwing exceptions like `BufferUnderflowException`, `NegativeArraySizeException`, etc. `Schema.read` catches these exceptions and adds some useful information like:

      throw new SchemaException("Error reading field '" + fields[i].name +
                                                "': " +
                                                (e.getMessage() == null ? e.getClass().getName() : e.getMessage()));
      

      We could do even better by throwing a `SchemaException` with a more user friendly message.

        Attachments

          Activity

            People

            • Assignee:
              ijuma Ismael Juma
              Reporter:
              ijuma Ismael Juma
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: