Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3249

Blocking call while performing ResteasyJackson2Provider.writeTo when using OpenJDK 11+

XMLWordPrintable

    • Icon: Quality Risk Quality Risk
    • Resolution: Done
    • Icon: Major Major
    • 5.0.5.Final, 6.2.2.Final
    • 4.7.6.Final, 6.2.1.Final
    • Core
    • None

      We have identified a blocking call with the help of Blockhound while trying to perform HTTP operations with reactor-netty.

      We have tested this scenario enabling Blockhound and identified the blocking call with OpenJDK 11 and 17.

      Attached the stack trace of the blocking call exception here : blocking_call_log.txt

      On analysing the blocking call trace and the OpenJDK changes, the blocking call is happening while,

      • The ResteasyJackson2Provider trying to write the request body which internally tries whitelist the classes for deserialisation via WhiteListPolymorphicTypeValidatorBuilder class.
      • This class tried to load the baseType and subType properties from Configuration object(ConfigurationFactory.getInstance()) loaded via ServiceLoader.
      • The ServiceLoader prior to OpenJDK 9, uses ServiceLoader.LazyIterator to iterate and load the providers
      • After OpenJDK 9, the above step is done via ServiceLoader.LazyClassPathLookupIterator which is the main flow for causing the blocking call

      Reproduced the blocking call with a test case (MonoTest.testMonoMap()) in rest-easy under this repo : https://github.com/anthochristen/resteasy/tree/blocking-write-issue

       

            Unassigned Unassigned
            alwinjmjak Alwin Shobanraj M
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: