Modfiy handling pending item 39/318539/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Oct 2024 02:04:13 +0000 (11:04 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 2 Oct 2024 02:04:13 +0000 (11:04 +0900)
There is a problem that when an execution request for the same app is delivered
before AMD executes the app and obtains the PID information, it cannot deliver
the PID information to the proxy. This problem creates a blocking state in the proxy.
In the FlushPendingRequests() method, if the request type is 'rpc-port',
modify it so that the result is immediately delivered to the caller.

Change-Id: I13334803267e1297df1d1a17ce673ef40feacb4d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_launch.cc
src/lib/request/request_manager.cc

index b5570f7a3d69e70f8522b30c52ce5af40e1a112d..dd69cee010aaf673ce4ca695dc99dc6d39560c7f 100644 (file)
@@ -1403,6 +1403,7 @@ static int OnLaunchManagerAppLaunched(const char* msg, int arg1, int arg2,
   if (pid < 0) {
     if (launch_context->IsPending()) {
       auto& pending_item = launch_context->GetPendingItem();
+      pending_item->SetPid(pid);
       auto& inst = amd::RequestManager::GetInst();
       inst.FlushPendingReplyInfos(pending_item, false);
       inst.FlushPendingRequests(pending_item);
index c500dd42857d4a050ba51b177510b7d3654e2f9a..f95296fb766bbb6993be88b4144b65fd1ca4b99e 100644 (file)
@@ -217,9 +217,13 @@ void RequestManager::FlushPendingRequests(std::shared_ptr<PendingItem> item) {
   if (item == nullptr)
     return;
 
+  pid_t pid = item->GetPid();
   auto& requests = item->GetRequests();
-  requests.remove_if([this](RequestPtr& req) -> bool {
+  requests.remove_if([this, pid](RequestPtr& req) -> bool {
         req->UnsetTimer();
+        if (req->GetRequestType() == "rpc-port")
+          req->SendResult(pid);
+
         PushRequest(std::move(req), AMD_PRIORITY_70);
         return true;
       });