Skip to content

Plasma photon association: passing through plasma address with photon db connection #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

atumanov
Copy link
Contributor

No description provided.

@@ -243,7 +243,8 @@ def start_ray_local(node_ip_address="127.0.0.1", num_workers=0, num_local_schedu
object_store_manager_names.append(object_store_manager_name)
time.sleep(0.1)
# Start the local scheduler.
local_scheduler_name = start_local_scheduler(redis_address, object_store_name, object_store_manager_name, cleanup=True)
plasma_address = "%s:%s" %(node_ip_address, object_store_manager_port)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use "{}:{}".format(node_ip_address, object_store_manager_port) here instead to be consistent with the rest of the python codebase?

CHECK(reply);
if (reply->type != REDIS_REPLY_NIL) {
freeReplyObject(reply);
break;
}
freeReplyObject(reply);
printf("redis_db_connect: end of while loop\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this

(char *) client.id, sizeof(client.id), client_type,
client_addr, client_port, (char *) client.id,
sizeof(client.id), aux_address);
CHECK_REDIS_CONNECT(redisContext, context,
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be just CHECKM(reply != NULL, "db_connect failed on HMSET");
The CHECK_REDIS_CONNECT is only for redisConnect commands, not for redisCommand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, CHECK_REDIS_CONNECT macro is more general than its name suggests. It can check any redis context for an error code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should probably rename the macro.

CHECKM(reply != NULL, "db_connect failed on HMSET");
/* allocate space for the published message */
char *tmpbuf =
malloc(strlen(client_type) + 1 + strlen(aux_address + 1 + 1));
Copy link
Contributor

@pcmoritz pcmoritz Dec 13, 2016

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

int rv = sscanf(1 + payload->str + sizeof(client.id), "%s %s", client_type,
aux_address);
if (rv < 2) {
/* Backward-compatibility: try to extract client_type only. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we just omit that? We don't need to be backwards compatible (yet), right?

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 an attempt to handle the case when we parse fewer than expected number of string tokens. But I'll replace that with an explicit assert.

char *aux_address = malloc(client_type_length);
memset(aux_address, 0, client_type_length);
/* Published message format: <client_id:client_type aux_addr> */
int rv = sscanf(1 + payload->str + sizeof(client.id), "%s %s", client_type,
Copy link
Contributor

Choose a reason for hiding this comment

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

&payload->str[1 + sizeof(client.id)]

@atumanov atumanov force-pushed the plasma-photon-association branch 2 times, most recently from cd04142 to 49d43e6 Compare December 13, 2016 20:50
@atumanov atumanov force-pushed the plasma-photon-association branch from a4d832a to 1c99f58 Compare December 13, 2016 21:16
@robertnishihara robertnishihara merged commit 9462429 into ray-project:master Dec 14, 2016
@robertnishihara robertnishihara deleted the plasma-photon-association branch December 14, 2016 01:21
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.

3 participants