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

        Hakim Sadikali created issue -
        Hide
        Hakim Sadikali added a comment -

        a possible patch.

        Show
        Hakim Sadikali added a comment - a possible patch.
        Hakim Sadikali made changes -
        Field Original Value New Value
        Attachment MapEntries.java [ 12513009 ]
        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.
        Felix Meschberger made changes -
        Assignee Felix Meschberger [ fmeschbe ]
        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
        Felix Meschberger made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s JCR Resource 2.1.0 [ 12316202 ]
        Resolution Fixed [ 1 ]
        Carsten Ziegeler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12651679 ] Copy of no-reopen-closed,doc-test-required [ 12762642 ]
        Gavin made changes -
        Workflow Copy of no-reopen-closed,doc-test-required [ 12762642 ] no-reopen-closed,doc-test-required [ 12766507 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12766507 ] re-open possible,doc-test-required [ 12787986 ]
        Gavin made changes -
        Workflow re-open possible,doc-test-required [ 12787986 ] no-reopen-closed,doc-test-required [ 12790820 ]

          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