From 4d51ed37b2a9c11760687705ab480b5d8022614c Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Wed, 31 May 2017 22:37:29 -0700 Subject: [PATCH] Fix bug in which plasma client file descriptors were not closed. (#618) * Fix bug in which plasma client file descriptors were not closed. * Add logging statement when disconnecting client from plasma store. * Fix after rebasing. * Add more checks to plasma disconnect client. --- src/plasma/plasma_store.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plasma/plasma_store.cc b/src/plasma/plasma_store.cc index 39e632a03..9fa4ea446 100644 --- a/src/plasma/plasma_store.cc +++ b/src/plasma/plasma_store.cc @@ -407,7 +407,12 @@ void PlasmaStore::connect_client(int listener_sock) { } void PlasmaStore::disconnect_client(Client *client) { + ARROW_CHECK(client != NULL); + ARROW_CHECK(client->fd > 0); loop_->remove_file_event(client->fd); + // Close the socket. + close(client->fd); + ARROW_LOG(INFO) << "Disconnecting client on fd " << client->fd; // If this client was using any objects, remove it from the appropriate // lists. for (const auto &entry : store_info_.objects) {