Sling
  1. Sling
  2. SLING-2398

Sling Mappings creates new threads to reload mappings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JCR Resource 2.0.10
    • Fix Version/s: JCR Resource 2.1.0
    • Component/s: JCR
    • Labels:

      Description

      Whenever the /etc/map or a sling:vanityPath, sling:vanityOrder or sling:redirect is modified a new thread is created to recreate the maps. If these values get modified very quickly, then its possible to create too many new threads and kill the system. A better implementation would be to check to see if a thread is running and reuse that thread.

      1. MapEntries.java
        18 kB
        Hakim Sadikali

        Activity

        Hide
        Hakim Sadikali added a comment -

        a possible patch.

        Show
        Hakim Sadikali added a comment - a possible patch.
        Hide
        Felix Meschberger added a comment -

        Thanks for reporting and providing a possible patch.

        I am right now working on this issue (and also the potential concurrency of the init method). I am considering taking a slightly different route, though: I will create a thread upfront and use some signalling to the thread to kick the initialization method.

        Show
        Felix Meschberger added a comment - Thanks for reporting and providing a possible patch. I am right now working on this issue (and also the potential concurrency of the init method). I am considering taking a slightly different route, though: I will create a thread upfront and use some signalling to the thread to kick the initialization method.
        Hide
        Justin Edelson added a comment -

        What about just creating a single threaded queue with Executors.newSingleThreadExecutor() and then submitting tasks into that queue?

        Show
        Justin Edelson added a comment - What about just creating a single threaded queue with Executors.newSingleThreadExecutor() and then submitting tasks into that queue?
        Hide
        Felix Meschberger added a comment -

        Updated the asynchronous handling in Rev. 1239916

        A single thread is created which handles updates. On event the update is triggered. A lock is used to prevent concurrent updates and cleanup during shutdown.

        Show
        Felix Meschberger added a comment - Updated the asynchronous handling in Rev. 1239916 A single thread is created which handles updates. On event the update is triggered. A lock is used to prevent concurrent updates and cleanup during shutdown.
        Hide
        Felix Meschberger added a comment -

        > What about just creating a single threaded queue

        I've done something along these lines, yes.

        Show
        Felix Meschberger added a comment - > What about just creating a single threaded queue I've done something along these lines, yes.
        Hide
        Felix Meschberger added a comment -

        Works now with a single thread

        Show
        Felix Meschberger added a comment - Works now with a single thread

          People

          • Assignee:
            Felix Meschberger
            Reporter:
            Hakim Sadikali
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development