Hi Devs,
I fixed the stratos component startup synchronization issue and pushed
changes to master branch. Now stratos components starts in the following
order:
Cloud Controller -> Autoscaler -> Stratos Manager
How it works:
- A new distributed map was introduced to keep track of the status of each
component [1].
- In single JVM mode the above map becomes a singleton.
- Whenever a component becomes active it will update the above map.
- If Autoscaler starts first it will wait until Cloud Controller becomes
active.
- If Stratos Manager starts first it will wait until Autoscaler and Cloud
Controller become active.
- In a distributed deployment the same logic will apply.
- Introduced a new handler [2] in REST API to avoid API method being
executed until Stratos Manager becomes active, if invoked following
response will be sent to the client:
HTTP/1.1 406 Not Acceptable
{"message":"Stratos manager component is not active"}
[1]
https://github.com/apache/stratos/blob/master/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/internal/ComponentStartUpSynchronizerImpl.java
[2]
https://github.com/apache/stratos/blob/master/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/handlers/ComponentSynchronizerHandler.java
Thanks
--
Imesh Gunaratne
Technical Lead, WSO2
Committer & PMC Member, Apache Stratos