[ 
https://issues.apache.org/jira/browse/USERGRID-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15300113#comment-15300113
 ] 

ASF GitHub Bot commented on USERGRID-1283:
------------------------------------------

GitHub user snoopdave opened a pull request:

    https://github.com/apache/usergrid/pull/528

    Improvements to management app / startup logic

    REVIEW PURPOSES ONLY
    
    NOT READY FOR MERGE
    
    Changes related to management app / startup logic
    
    1) Change CpEntityManagerFactory startup logic to retry when it encounters 
Cassandra problems when fetching the Management App.
    
    2) Improves EntityManager cache logic (in CpEntityManagerFactory) to ensure 
that we do not cache EntityManagers that may be in a bad state because we 
cannot fetch their application data from Cassandra.
    
    3) Adds special EntityManager cache logic for the Management App: once we 
get the management app we cache it separately in case some Cassandra hiccup 
keeps us from fetching it we we need it later.
    
    4) EntityManager cache size configurable via a new property 
''entity.manager.cache.size"
    
    https://issues.apache.org/jira/browse/USERGRID-1283

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/snoopdave/usergrid usergrid-1283-mgmt-app-init

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/usergrid/pull/528.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #528
    
----
commit e0c0c875271cda47f9baf9072f029a92921fd1be
Author: Dave Johnson <[email protected]>
Date:   2016-05-16T20:10:07Z

    Move the initial get of management app to the CpEntityManagerFactory with 
retries, and caching for the management app itself.

commit 5f463412b661c7b681489d8831fc2c7c7d32938a
Author: Dave Johnson <[email protected]>
Date:   2016-05-18T13:18:21Z

    Improve cache logic to avoid caching "bad" entity managers and to ensure 
that manager app is always available.
    Should be no reason to use a retry loop because the system will continue to 
call for EntityManagers.
    Adds new "entity.manager.cache.size" property, which defaults to 100.

commit de6de6629903f57df4faf5c3f20f5cea63f2bcec
Author: Dave Johnson <[email protected]>
Date:   2016-05-18T13:23:54Z

    Merge branch 'usergrid-1283-service-mgr-init' into 
usegrid-1283-mgmt-app-init
    
    Conflicts:
        
stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java

commit 12743f3e221f80df7eab89fda08325e9775f7ae9
Author: Dave Johnson <[email protected]>
Date:   2016-05-20T18:03:53Z

    Revert changes to initMgmtApp() and add null-pointer check.

commit 8ebc28dfd8e0d1abe4edec8a3941175238400ea4
Author: Dave Johnson <[email protected]>
Date:   2016-05-24T14:01:25Z

    Merge branch 'release-2.1.1' into usegrid-1283-mgmt-app-init

commit 6daba1d7d3dd9ce65644229af87f0440cee53117
Author: Dave Johnson <[email protected]>
Date:   2016-05-25T14:08:06Z

    Merge branch 'release-2.1.1' into usergrid-1283-mgmt-app-init
    
    Conflicts:
        
stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java

----


> Improve ServiceManager.init() start-up logic
> --------------------------------------------
>
>                 Key: USERGRID-1283
>                 URL: https://issues.apache.org/jira/browse/USERGRID-1283
>             Project: Usergrid
>          Issue Type: Improvement
>    Affects Versions: 2.1.0
>            Reporter: David Johnson
>             Fix For: 2.1.1
>
>
> Sometimes on Usergrid startup there is a failure contacting Cassandra, either 
> an immediate communications failure or a time-out.
> In some cases when this happens, the ServiceManager.init() method cannot 
> retrieve the internal Management Application that holds information about 
> Usergrid orgs, app and admin users.  
> We added some retry logic to the ServiceManager.init() method, which is not 
> an ideal fix because that method is also invoked in processing of HTTP 
> requests.  Problem is, if the the retries do not work we end up with an 
> instance of Usergrid that is alive and able to respond to /status requests, 
> but everything else fails.
> We should fix this by:
> 1) Moving the Management App lookup (and retry logic) to a much earlier point 
> in the startup process. 
> 2) Caching the Management App in some place where all threads can get it. 
> This cache should never be allowed to be null.  We always need to be able to 
> fall back to a recent version of the Management App



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to