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

Improve protocol type errors when invalid sizes are received

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.0.0
    • 0.10.0.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: