Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3775

Concurrency issue causing PropertyModel.getCachedCodec to return null

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.2.0
    • 3.12.5
    • POJO
    • None
    • java 8, mongodb 4.2.8

    Description

      I'm getting a NullPointerException in EncoderContext.encodeWithChildContext when encoding POJO's with many nested objects using multiple threads.

      After a random number of serializations PropertyModel.getCachedCodec keeps returning null and the method fails when it is called by PojoCodecImpl.encodeValue

      • Simplifying the POJO structure reduces the chance on exceptions; as does lowering the amount of threads or adding delays.
      • When running on a single thread no exceptions are thrown

      The issue could be related to / the same asĀ JAVA-3606; however the attached example code reproduces the issue.

      Attachments

        1. example.zip
          171 kB
        2. stacktrace.txt
          4 kB

        Activity

          People

            ross@mongodb.com Ross Lawley
            jsikkes@xs4all.nl Jeroen Sikkes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: