View | Details | Raw Unified | Return to ticket 3520
Collapse All | Expand All

(-)a/src/plugins/mpi/pmi2/pmi2.c (+23 lines)
Lines 598-603 handle_pmi2_cmd(int fd, int lrank) Link Here
598
598
599
	debug2("mpi/pmi2: got client request: %s %s", len_buf, buf);
599
	debug2("mpi/pmi2: got client request: %s %s", len_buf, buf);
600
600
601
	if (!len) {
602
		/*
603
		 * This is an invalid request.
604
		 *
605
		 * The most likely cause of an invalid client request is a
606
		 * second PMI2_Init call from the client end. This arrives
607
		 * first as a "cmd=init" call. Ideally, we'd capture that
608
		 * request, and respond with "cmd=response_to_init" with the rc
609
		 * field set to PMI2_ERR_INIT and expect the client to cleanup
610
		 * and die correctly.
611
		 *
612
		 * However - Slurm's libpmi2 has historically ignored the rc
613
		 * value and immediately sends the FULLINIT_CMD regardless, and
614
		 * then waits for a response to that. Rather than construct
615
		 * two successive error messages, this call will send back
616
		 * "cmd=finalize-response" back that will trigger the desired
617
		 * error handling paths, and then tears down the connection
618
		 * for good measure.
619
		 */
620
		_handle_finalize(fd, 0, NULL);
621
		return SLURM_ERROR;
622
	}
623
601
	req = client_req_init(len, buf);
624
	req = client_req_init(len, buf);
602
	if (req == NULL) {
625
	if (req == NULL) {
603
		error("mpi/pmi2: invalid client request");
626
		error("mpi/pmi2: invalid client request");

Return to ticket 3520