Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-7002

Application metadata access should not require synchronization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 8.14.0, 9.11.0
    • 10.0.0-M1, 9.12.0, 8.15.0
    • wicket-core
    • None

    Description

      The methods getMetaData and setMetaData from Application have synchronized modifiers applied to them such that they block on the application instance.

      This can cause blocking issues. When I looked at the monitor usage in our application running in production the Application metadata locks are responsible for 57% of all monitor usage.

      I've included a screenshot of the monitor usage reverse call stacks.

      The implementation should be changed to a ConcurrentHashMap so we can remove the synchronization from the getter and setter, and just use the hashmap's O(1) lookup rather than MetaDataKey's O( 1) lookup. This will eliminate the blocking and (possibly) long lookups of metadata in the Application instance.

      Note this does not involve modifying the component, session or requestcycle metadata implementations (yet).

      IMO this should be backported to at least 9, as this is a semver compatible change.

      Attachments

        1. Screenshot 2022-09-02 at 17.18.44.png
          574 kB
          Martijn Dashorst

        Activity

          People

            Unassigned Unassigned
            dashorst Martijn Dashorst
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: