mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 17:45:08 +08:00
Send a one byte message in send_fd because otherwise it sometimes hangs on Linux. (#41)
This commit is contained in:
committed by
Philipp Moritz
parent
5ad8e145ae
commit
f189ca746b
+4
-2
@@ -164,8 +164,10 @@ int plasma_subscribe(plasma_store_conn *conn) {
|
||||
plasma_request req = {};
|
||||
plasma_send_request(conn->conn, PLASMA_SUBSCRIBE, &req);
|
||||
/* Send the file descriptor that the Plasma store should use to push
|
||||
* notifications about sealed objects to this client. */
|
||||
send_fd(conn->conn, fd[1], NULL, 0);
|
||||
* notifications about sealed objects to this client. We include a one byte
|
||||
* message because otherwise it seems to hang on Linux. */
|
||||
char dummy = '\0';
|
||||
send_fd(conn->conn, fd[1], &dummy, 1);
|
||||
/* Return the file descriptor that the client should use to read notifications
|
||||
* about sealed objects. */
|
||||
return fd[0];
|
||||
|
||||
+2
-1
@@ -282,7 +282,8 @@ void send_notifications(event_loop *loop,
|
||||
/* Subscribe to notifications about sealed objects. */
|
||||
void subscribe_to_updates(plasma_store_state *s, int conn) {
|
||||
LOG_DEBUG("subscribing to updates");
|
||||
int fd = recv_fd(conn, NULL, 0);
|
||||
char dummy;
|
||||
int fd = recv_fd(conn, &dummy, 1);
|
||||
CHECKM(HASH_CNT(handle, s->open_objects) == 0,
|
||||
"plasma_subscribe should be called before any objects are created.");
|
||||
CHECKM(HASH_CNT(handle, s->sealed_objects) == 0,
|
||||
|
||||
Reference in New Issue
Block a user