Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-11781

Invalid mode while deserializing JTS geometry objects with binary marshaller

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7
    • None
    • binary, clients, compute
    • Tested on a 64 bit Ubuntu 18.04, with OpenJDK 1.8.0_191, running Ignite 2.7

    Description

      JTS Geometry objects can't be used as return types of compute jobs. Instead, null is returned. Here's a minimal example showing the bug (and one example that shows that the bug is sometimes not triggered under slightly different conditions):

       

      // this prints "null" (wrong – the expected result would be "POINT EMPTY"):
      igniteCompute.broadcast(() -> (new GeometryFactory()).createPoint()).forEach(System.out::println);
      // this prints "[POINT EMPTY]" (correct):
      igniteCompute.broadcast(() -> Collections.singletonList((new GeometryFactory()).createPoint())).forEach(System.out::println);
      

      This is caused by an invalid BinaryWriteMode of OPTIMIZED in https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L852 which then leads to a null value to be returned a few lines further down: https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L882

      From what I can see, the OPTIMIZED mode is set in https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L161 where the objects are explicitly tested against the org.locationtech.jts.geom.Geometry class. This could be a regression introduced in https://issues.apache.org/jira/browse/IGNITE-4259 ?

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            tyr_asd Martin Raifer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: