Skip to content
Snippets Groups Projects
Commit 9c34fa32 authored by Moe Jette's avatar Moe Jette
Browse files

Port some sched/wiki2 scalability bug fixes into sched/wiki

parent eccb3f78
No related branches found
No related tags found
No related merge requests found
...@@ -315,7 +315,7 @@ static size_t _write_bytes(int fd, char *buf, const size_t size) ...@@ -315,7 +315,7 @@ static size_t _write_bytes(int fd, char *buf, const size_t size)
static char * _recv_msg(slurm_fd new_fd) static char * _recv_msg(slurm_fd new_fd)
{ {
char header[10]; char header[10];
uint32_t size; unsigned long size;
char *buf; char *buf;
if (_read_bytes((int) new_fd, header, 9) != 9) { if (_read_bytes((int) new_fd, header, 9) != 9) {
...@@ -325,7 +325,7 @@ static char * _recv_msg(slurm_fd new_fd) ...@@ -325,7 +325,7 @@ static char * _recv_msg(slurm_fd new_fd)
return NULL; return NULL;
} }
if (sscanf(header, "%ul", &size) != 1) { if (sscanf(header, "%lu", &size) != 1) {
err_code = -244; err_code = -244;
err_msg = "malformed message header"; err_msg = "malformed message header";
error("wiki: malformed message header (%s)", header); error("wiki: malformed message header (%s)", header);
...@@ -357,7 +357,7 @@ static size_t _send_msg(slurm_fd new_fd, char *buf, size_t size) ...@@ -357,7 +357,7 @@ static size_t _send_msg(slurm_fd new_fd, char *buf, size_t size)
debug("wiki msg send:%s", buf); debug("wiki msg send:%s", buf);
(void) sprintf(header, "%08ld\n", (long int) size); (void) sprintf(header, "%08lu\n", (unsigned long) size);
if (_write_bytes((int) new_fd, header, 9) != 9) { if (_write_bytes((int) new_fd, header, 9) != 9) {
error("wiki: failed to write message header %m"); error("wiki: failed to write message header %m");
return 0; return 0;
......
...@@ -51,7 +51,7 @@ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg) ...@@ -51,7 +51,7 @@ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg)
int i; int i;
uint32_t jobid; uint32_t jobid;
hostlist_t hl; hostlist_t hl;
char host_string[1024]; char host_string[2048];
static char reply_msg[128]; static char reply_msg[128];
arg_ptr = strstr(cmd_ptr, "ARG="); arg_ptr = strstr(cmd_ptr, "ARG=");
...@@ -82,12 +82,22 @@ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg) ...@@ -82,12 +82,22 @@ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg)
node_ptr[i] = ','; node_ptr[i] = ',';
} }
hl = hostlist_create(node_ptr); hl = hostlist_create(node_ptr);
if (hl == NULL) {
*err_code = -300;
*err_msg = "STARTJOB TASKLIST is invalid";
error("wiki: STARTJOB TASKLIST is invalid: %s",
node_ptr");
return -1;
}
hostlist_uniq(hl); /* for now, don't worry about task layout */
hostlist_sort(hl);
i = hostlist_ranged_string(hl, sizeof(host_string), host_string); i = hostlist_ranged_string(hl, sizeof(host_string), host_string);
hostlist_destroy(hl); hostlist_destroy(hl);
if (i < 0) { if (i < 0) {
*err_code = -300; *err_code = -300;
*err_msg = "STARTJOB has invalid TASKLIST"; *err_msg = "STARTJOB has invalid TASKLIST";
error("wiki: STARTJOB has invalid TASKLIST"); error("wiki: STARTJOB has invalid TASKLIST: %s",
host_string);
return -1; return -1;
} }
if (_start_job(jobid, host_string, err_code, err_msg) != 0) if (_start_job(jobid, host_string, err_code, err_msg) != 0)
...@@ -146,7 +156,7 @@ static int _start_job(uint32_t jobid, char *hostlist, ...@@ -146,7 +156,7 @@ static int _start_job(uint32_t jobid, char *hostlist,
*err_msg = "Invalid TASKLIST"; *err_msg = "Invalid TASKLIST";
error("wiki: Attempt to set invalid node list for job %u, %s", error("wiki: Attempt to set invalid node list for job %u, %s",
jobid, hostlist); jobid, hostlist);
xfree(hostlist); xfree(new_node_list);
rc = -1; rc = -1;
goto fini; goto fini;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment