You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Hakim Sadikali (Created) (JIRA)" <ji...@apache.org> on 2012/02/02 19:10:54 UTC

[jira] [Created] (SLING-2398) Sling Mappings creates new threads to reload mappings

Sling Mappings creates new threads to reload mappings
-----------------------------------------------------

                 Key: SLING-2398
                 URL: https://issues.apache.org/jira/browse/SLING-2398
             Project: Sling
          Issue Type: Bug
          Components: JCR
    Affects Versions: JCR Resource 2.0.10
            Reporter: Hakim Sadikali


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Felix Meschberger (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199356#comment-13199356 ] 

Felix Meschberger commented on SLING-2398:
------------------------------------------

> What about just creating a single threaded queue

I've done something along these lines, yes.
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Felix Meschberger (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-2398:
----------------------------------------

    Assignee: Felix Meschberger
    
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-2398.
-----------------------------------

    
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>             Fix For: JCR Resource 2.1.0
>
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Hakim Sadikali (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hakim Sadikali updated SLING-2398:
----------------------------------

    Attachment: MapEntries.java

a possible patch.
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Felix Meschberger (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-2398.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: JCR Resource 2.1.0

Works now with a single thread
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>             Fix For: JCR Resource 2.1.0
>
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Justin Edelson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199317#comment-13199317 ] 

Justin Edelson commented on SLING-2398:
---------------------------------------

What about just creating a single threaded queue with Executors.newSingleThreadExecutor() and then submitting tasks into that queue?
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Felix Meschberger (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199349#comment-13199349 ] 

Felix Meschberger commented on SLING-2398:
------------------------------------------

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.
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>            Assignee: Felix Meschberger
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SLING-2398) Sling Mappings creates new threads to reload mappings

Posted by "Felix Meschberger (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199195#comment-13199195 ] 

Felix Meschberger commented on SLING-2398:
------------------------------------------

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.
                
> Sling Mappings creates new threads to reload mappings
> -----------------------------------------------------
>
>                 Key: SLING-2398
>                 URL: https://issues.apache.org/jira/browse/SLING-2398
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.0.10
>            Reporter: Hakim Sadikali
>              Labels: performance
>         Attachments: MapEntries.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira