[ 
https://issues.apache.org/jira/browse/ARROW-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16246721#comment-16246721
 ] 

ASF GitHub Bot commented on ARROW-1788:
---------------------------------------

pcmoritz commented on a change in pull request #1299: ARROW-1788 Fix Plasma 
store abort bug on client disconnection
URL: https://github.com/apache/arrow/pull/1299#discussion_r150112146
 
 

 ##########
 File path: cpp/src/plasma/store.cc
 ##########
 @@ -454,11 +454,15 @@ void PlasmaStore::disconnect_client(int client_fd) {
   ARROW_LOG(INFO) << "Disconnecting client on fd " << client_fd;
   // If this client was using any objects, remove it from the appropriate
   // lists.
+  auto client = it->second.get();
   for (const auto& entry : store_info_.objects) {
-    if (entry.second->state == PLASMA_SEALED) {
-      remove_client_from_object_clients(entry.second.get(), it->second.get());
-    } else {
-      abort_object(entry.first);
+    auto entry_it = entry.second->clients.find(client);
+    if (entry_it != entry.second->clients.end()) {
+      if (entry.second->state == PLASMA_SEALED) {
+        remove_client_from_object_clients(entry.second.get(), client);
 
 Review comment:
   As it is with this change, this check is a little asymetric, i.e. 
remove_client_from_object_clients already checks if the object is from the 
"right" client, but abort_object doesn't and then here we check in either case. 
Can you make it more symmetric and handle the checks in the same way? We could 
have the check in abort_object if we also pass the client and remove it from 
here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Plasma store crashes when trying to abort objects for disconnected client
> -------------------------------------------------------------------------
>
>                 Key: ARROW-1788
>                 URL: https://issues.apache.org/jira/browse/ARROW-1788
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Plasma (C++)
>    Affects Versions: 0.8.0
>            Reporter: Stephanie Wang
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> ARROW-1775 introduces the ability to abort objects in the Plasma store. When 
> a client disconnects, the store iterates through all of the objects and 
> either removes the client from the list of object users or aborts the object, 
> depending on whether the object was sealed or not.
> Before aborting the object, the store does not first check whether the client 
> was the one who created the object. Right now, if a different client created 
> the object, the store will crash when aborting it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to