Hi,

Since there are some concerns[1] in calculating md5sum for application
artifacts,

[1] Cannot generate a single md5 for a directory.( in jaggery case)

When we run application servers with EXPLODED_MODE = ON (which is the
recommended way for production) war files will get extracted in  the
deployment stage. This will cause [1].

For these reasons we decided to go with application lastmodified time [2].
This lastmodifiedtime is stored in rxt for the particular appversion. And
it is compared with the current app modificationtime before sending a
deployment notification.

In fact there are some scenarios which this solution will fail (like if
there is a change happen inside the application directory due to a user
action, same app redeployment). But most of the typical cases + the
scenarios mentioned above by Dimuthu>

1 - Artifact is getting deployed for the first time and tenant is already
loaded sometime ago
2 - Artifact is getting deployed for the first time while tenant is getting
loaded
3 - Artifact is getting redeployed and the tenant is already loaded
sometime ago
4 - Artifact is getting redeployed while the tenant is getting loaded

are covered by this.

[2] artifactLastModifiedTime = new File(<applocation>).lastModified();


On Sat, Jul 5, 2014 at 9:49 AM, Ajanthan Balachandran <[email protected]>
wrote:

>
>
>
> On Sat, Jul 5, 2014 at 2:32 AM, Dimuthu Leelarathne <[email protected]>
> wrote:
>
>> Hi Ajanthan and all,
>>
>> 1 - Artifact is getting deployed for the first time and tenant is already
>> loaded sometime ago
>> 2 - Artifact is getting deployed for the first time while tenant is
>> getting loaded
>> 3 - Artifact is getting redeployed and the tenant is already loaded
>> sometime ago
>> 4 - Artifact is getting redeployed while the tenant is getting loaded
>>
>> That code wouldn't work for 2nd and 4th, IMO. Is that the case?
>>
> Yes,It doesn't work.Since we are committing the artifact first and loading
> the tenant by pinging the url there is a high probability to scenario 2 and
> 4 happen at-least first time deployment.
>
>>
>> thanks,
>> dimuthu
>>
>>
>>
>>
>>
>> On Fri, Jul 4, 2014 at 11:34 PM, Ashansa Perera <[email protected]> wrote:
>>
>>> If lastAccessedTime is -1 at the time tenant is loading, I feel that
>>> this is a good approach.
>>>  On Jul 4, 2014 12:07 PM, "Ajanthan Balachandran" <[email protected]>
>>> wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Tue, Jul 1, 2014 at 5:48 PM, Anuruddha Premalal <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Following is the problem-solution description regards to jira
>>>>> APPFAC-2252 <https://wso2.org/jira/browse/APPFAC-2252>
>>>>>
>>>>> *Problem :*
>>>>>
>>>>> AppServer tenant get unloaded when there is no activity for 30mins.
>>>>> When a user deploy an app to this unloaded tenant, it will load and deploy
>>>>> all previously deployed apps; current implementation use catalina
>>>>> LifecycleListner and it captures these redeployment events and triggers 
>>>>> the
>>>>> notifications.
>>>>>
>>>>> *Solution :*
>>>>>
>>>>> Send the artifact md5sum with the notification to the Appfactory.
>>>>> Appfactory will validate the md5 and push the wall message accordingly.
>>>>>
>>>> How about only publishing the events from a tenant after only if the
>>>> tenant is completely loaded(you can detect this status by checking
>>>> tenantConfigCtx.getProperty(MultitenantConstants.LAST_ACCESSED)[0]
>>>> ).We can filter out the deployment events that are happening due to tenant
>>>> loading using this method.
>>>>
>>>>>
>>>>>
>>>>> Regards,
>>>>> --
>>>>> *Anuruddha Premalal*
>>>>> Software Eng. | WSO2 Inc.
>>>>> Mobile : +94710461070
>>>>> Web site : www.regilandvalley.com
>>>>>
>>>>> "Advances of technology should not leave behind the developing world"
>>>>>
>>>>> _______________________________________________
>>>>> Architecture mailing list
>>>>> [email protected]
>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>
>>>>>
>>>> [0]
>>>>
>>>>          long lastAccessedTime
>>>> =TenantAxisUtils.getLastAccessed(tenantDomain,
>>>>                 ServiceHolder.getInstance()
>>>>
>>>> .getConfigContextService().getServerConfigContext());
>>>>
>>>>
>>>>         if(lastAccessedTime!=-1){
>>>>             log.info("[sendNotification] Tenant : "+tenantDomain+"
>>>> appid : "+appId+" msg : "+msg);
>>>>         }else {
>>>>             log.info("[sendNotification] ignoring..........tenant is
>>>> not loaded " );
>>>>         }
>>>>
>>>> --
>>>> ajanthan
>>>> --
>>>> Ajanthan Balachandiran
>>>> Senior Software Engineer;
>>>> Solutions Technologies Team ;WSO2, Inc.;  http://wso2.com/
>>>>
>>>> email: ajanthan <http://goog_595075977>@wso2.com; cell: +94775581497
>>>> blog: http://bkayts.blogspot.com/
>>>>
>>>> Lean . Enterprise . Middleware
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> [email protected]
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Dimuthu Leelarathne
>> Architect & Product Lead of App Factory
>>
>> WSO2, Inc. (http://wso2.com)
>> email:
>> [email protected]
>> Mobile : 0773661935
>>
>> Lean . Enterprise . Middleware
>>
>
>
>
> --
> ajanthan
> --
> Ajanthan Balachandiran
> Senior Software Engineer;
> Solutions Technologies Team ;WSO2, Inc.;  http://wso2.com/
>
> email: ajanthan <http://goog_595075977>@wso2.com; cell: +94775581497
> blog: http://bkayts.blogspot.com/
>
> Lean . Enterprise . Middleware
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
*Anuruddha Premalal*
Software Eng. | WSO2 Inc.
Mobile : +94710461070
Web site : www.regilandvalley.com

"Advances of technology should not leave behind the developing world"
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to