Skip to content

Conversation

@suquark
Copy link
Contributor

@suquark suquark commented Feb 19, 2019

This is replacing the socket based IO with boost asio so plasma can be ported to windows.

@pcmoritz
Copy link
Contributor

@suquark Can you remove the asio commit? We don't want to commit asio into here, let me know if you need help to integrate asio into the build system!

@suquark
Copy link
Contributor Author

suquark commented Feb 20, 2019

@pcmoritz Yes, I would like to know how to integrate asio. Should we download the source when building plasma?

@suquark suquark force-pushed the plasma branch 2 times, most recently from a45202c to 37fb5d2 Compare February 20, 2019 03:42
@suquark
Copy link
Contributor Author

suquark commented Feb 20, 2019

I have rebased the branch to resolve conflicts.

@zhijunfu
Copy link
Contributor

@suquark Just FYI. If I understand correctly boost::asio::local::stream_protocol is only supported on POSIX systems, on windows you might need boost::asio::windows::stream_handle or local TCP? Also on linux it's reported that AF_UNIX is has better performance over tcp, thus it might not be very desirable to use local TCP on all platforms.

@suquark suquark force-pushed the plasma branch 2 times, most recently from 9967441 to 14b25ea Compare February 22, 2019 10:38
@suquark suquark force-pushed the plasma branch 5 times, most recently from 565ceda to 10f28fd Compare March 7, 2019 14:30
@suquark
Copy link
Contributor Author

suquark commented Mar 10, 2019

@robertnishihara @pcmoritz It is ready for review. The CI failure comes from the master branch.

@suquark
Copy link
Contributor Author

suquark commented Mar 10, 2019

I have removed most unix-only headers for cross-platform compiling, but we still cannot build it on Windows because the shared memory operation is not windows-compatible. I would like to fix this in a following PR.

Copy link
Contributor

@pcmoritz pcmoritz Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be formatted more like the following to be consistent with ThirdpartyToolchain.cmake. Maybe even consider to add it there?

ExternalProject_Add(asio_ep
  URL https://github.com/chriskohlhoff/asio/archive/asio-1-12-2.zip
  CONFIGURE_COMMAND "" # No autogen since we use asio in header-only way.
  BUILD_IN_SOURCE 1
  BUILD_COMMAND ""
  INSTALL_COMMAND
    cmake -E copy asio/include/asio.hpp ${OUTPUT_DIR}/.. &&
    cmake -E copy_directory asio/include/asio ${OUTPUT_DIR}/../asio/)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was formatted by the cmake format checker. I can move it into ThirdpartyToolchain.cmake to keep the currect format.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you hang on until the CMake refactor is merged to make sure this doesn't conflict (easier to fix this PR than to fix that)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Which PR is about CMake refactor?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@pcmoritz pcmoritz Mar 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not currently used, right? Let's remove it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this because we can use it under windows. Windows do not support unix domain sockets, so we can use tcp socket instead (or we can use UDP, since it would be more efficient).
And do you know how to build it with the CI under windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An if condition would be more idiomatic here I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to PlasmaStream (UPPER_CASE should be reserved for macros)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this to PlasmaAcceptor

@robertnishihara
Copy link
Contributor

@zhijunfu would you be interested in reviewing this PR?

emkornfield and others added 4 commits July 3, 2019 12:14
…elegate class.

This provides less "pluggability" but I think still offers a clean model for extension (subsystems can wrap the constructor for there purposes, and provide external static methods to check for particular types of errors).

Author: Micah Kornfield <emkornfield@gmail.com>
Author: Antoine Pitrou <antoine@python.org>

Closes apache#4484 from emkornfield/status_code_proposal and squashes the following commits:

4d1ab8d <Micah Kornfield> don't import plasma errors directly into top level pyarrow module
a66f999 <Micah Kornfield> make format
040216d <Micah Kornfield> fixes for comments outside python
729bba1 <Antoine Pitrou> Fix Py2 issues (hopefully)
ea56d1e <Antoine Pitrou> Fix PythonErrorDetail to store Python error state (and restore it in check_status())
21e1b95 <Micah Kornfield> fix compilation
9c905b0 <Micah Kornfield> fix lint
74d563c <Micah Kornfield> fixes
85786ef <Micah Kornfield> change messages
3626a90 <Micah Kornfield> try removing message
a4e6a1f <Micah Kornfield> add logging for debug
4586fd1 <Micah Kornfield> fix typo
8f011b3 <Micah Kornfield> fix status propagation
317ea9c <Micah Kornfield> fix complie
9f59160 <Micah Kornfield> don't make_shared inline
484b3a2 <Micah Kornfield> style fix
14e3467 <Micah Kornfield> dont rely on rtti
cd22df6 <Micah Kornfield> format
dec4585 <Micah Kornfield> not-quite pluggable error codes
@suquark
Copy link
Contributor Author

suquark commented Jul 15, 2019

@pcmoritz I have seen you removing the independent asio headers. Why doing so?

@pcmoritz
Copy link
Contributor

@suquark This way it is easier to integrate with Ray's build system (we already have boost as a dependency in both arrow's and Ray's build system so it seems logical to use them). I did it with minimal modification so it's easy to change, but I don't see a clear advantage of using the standalone one right now, do you? :)

@suquark
Copy link
Contributor Author

suquark commented Jul 15, 2019

@pcmoritz Oh, that makes sense then. Thx for doing that.

@emkornfield
Copy link
Contributor

What are the next steps with this PR?

@suquark
Copy link
Contributor Author

suquark commented Aug 29, 2019

@emkornfield I am going to fix these conflicts, and hopefully we can get it merged in the next few weeks.

Copy link
Member

@bkietz bkietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suquark this looks like a good start on an ambitious change. Could you rebase please?


#include "arrow/status.h"

namespace asio = boost::asio;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global namespace aliases in non-internal headers are against our coding style. Please either remove these aliases or confine them to the plasma::io namespace


--------------------------------------------------------------------------------

This project includes code from the Boost project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this notation necessary?

// under the License.

#ifndef PLASMA_IO_CONNECTION_H
#define PLASMA_IO_CONNECTION_H
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define PLASMA_IO_CONNECTION_H
#pragma once

}

// We have to fill the template of all possible types.
template class Connection<PlasmaStream>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An extern template like this is extremely difficult to get working under MSVC, and you only instantiate this template once anyway. Why is this a template instead of just defining PlasmaConnection directly in connection.h?

/// Disconnect a client from the PlasmaStore.
///
/// \param client The client that is disconnected.
void ProcessDisconnectClient(const std::shared_ptr<ClientConnection>& client);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the Process prefix?

if [ "${have_gandiva}" = "yes" ]; then
apt install -y -V libgandiva-glib-dev=${deb_version}
apt install -y -V libgandiva-glib-doc=${deb_version}
# apt install -y -V libgandiva-glib-doc=${deb_version}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this change about?


struct GetRequest {
GetRequest(Client* client, const std::vector<ObjectID>& object_ids);
GetRequest(asio::io_context& io_context,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's not the asio pattern, it may be necessary to pass these around by pointer to appease cpplint

}

// Send the get reply to the client.
Status s = SendGetReply(client, &object_ids[0], objects, object_ids.size(), store_fds,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this looks like it could segfault if object_ids is empty. Could be made more clear with:

Suggested change
Status s = SendGetReply(client, &object_ids[0], objects, object_ids.size(), store_fds,
Status s = SendGetReply(client, object_ids.data(), objects, object_ids.size(), store_fds,

@emkornfield
Copy link
Contributor

@suquark do you think you will have time to rebase and address the feedback?

@emkornfield
Copy link
Contributor

@suquark thank you for the PR if you have time to update it, please reopen. closing for now do to lack of response.

@suquark
Copy link
Contributor Author

suquark commented Oct 25, 2019

Sorry for my late response. Let me try to address these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.