Removing box directly without adding ecore queue when 'destroy' request is comming.
authorYunchan Cho <yunchan.cho@samsung.com>
Wed, 28 Aug 2013 09:40:55 +0000 (18:40 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Wed, 4 Sep 2013 06:09:15 +0000 (15:09 +0900)
[Issue]   N_SE-49607
[Problem] web-provider does not exit normally after deleting last d-box.
          This causes other OSP's d-boxes not becoming serviced by master provider.
[Cause]   timing regarding resource release is not matched between master and web-provider.
          - If web-provider returns boxDestroyCallback, master provider recognizes that
            this box has been removed clearly by web-provider and removes its resources for the web d-box.
          - And, then master provider requests to exit web-provider to AUL daemon.
          - But, at this time, web-provider may not finish to remove the requested box,
            because web-provider just add the request to ecore job queue.
          - When job for removing d-box is popped from the queue, the job is not guaranteed,
            because master provider doesn't know the box any more.

       master-provider                  web-provider
       1. delete box              --->  add ecore job
       2. remove box resource     <---  return
       3. call aul_terminate_pid  --->  (pending)
       4. (wait terminate event)  <---  release buffer
       5. (pending)               <-->  (pending)
       6. can't service other d-box

[Solution] web-provider guarantees to finish to remove d-box
           before it return result of boxDestroyCallback.
           To this end, web-provider dosen't add job into ecore queue.
           And it directly try to remove requested box.

Change-Id: I88e4028eac5a80896f6286e4992a50c5c8d08bac

src/Daemon/BoxDaemonImpl.cpp

index 11b17eb..ecf0163 100755 (executable)
@@ -249,10 +249,9 @@ int BoxDaemonImpl::boxDestroyCallback(ProviderEventArgPtr arg, void* data)
     LogD("InstanceId: %s", info->instanceId.c_str());
     LogD("--------------------------------------------");
 
-    JobInfo* jobInfo = new JobInfo(REQUEST_CMD_REMOVE_BOX, info, This);
-    Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+    This->m_pluginConnector->requestCommand(REQUEST_CMD_REMOVE_BOX, info);
 
-    return ret ? 0 : -1;
+    return 0;
 }
 
 int BoxDaemonImpl::pdCreateCallback(ProviderEventArgPtr arg, void* data)