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)
commit4443a835858bb608bece875c74a7b268cfd41864
treed5cc130bd5dd458bb9715e0e416d4f957d09eb42
parent39c49deaeb04cce8e2833ffbb4da7c9852413827
Removing box directly without adding ecore queue when 'destroy' request is comming.

[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