-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Plasma photon association: passing through plasma address with photon db connection #123
Conversation
@@ -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) |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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. */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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)]
cd04142
to
49d43e6
Compare
a4d832a
to
1c99f58
Compare
No description provided.