View | Details | Raw Unified | Return to ticket 3763 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/slurmctld/job_mgr.c (-7 / +26 lines)
Lines 8455-8467 static int _list_find_job_old(void *job_entry, void *key) Link Here
8455
	struct timeval tv_now = {0, 0};
8455
	struct timeval tv_now = {0, 0};
8456
	long delta_t;
8456
	long delta_t;
8457
8457
8458
	if (purge_quit)
8458
	if (purge_quit) {
8459
		info("job %u not purged, job purging all done for this iteration", job_ptr->job_id);
8459
		return 0;
8460
		return 0;
8461
	}
8460
	gettimeofday(&tv_now, NULL);
8462
	gettimeofday(&tv_now, NULL);
8461
	delta_t  = (tv_now.tv_sec - purge_start_time.tv_sec) * 1000000;
8463
	delta_t  = (tv_now.tv_sec - purge_start_time.tv_sec) * 1000000;
8462
	delta_t += tv_now.tv_usec;
8464
	delta_t += tv_now.tv_usec;
8463
	delta_t -= purge_start_time.tv_usec;
8465
	delta_t -= purge_start_time.tv_usec;
8464
	if (delta_t > 1000000) {
8466
	if (delta_t > 1000000) {
8467
		info("job %u not purged, purging timeout reached", job_ptr->job_id);
8465
		purge_quit = true;
8468
		purge_quit = true;
8466
		return 0;
8469
		return 0;
8467
	}
8470
	}
Lines 8473-8494 static int _list_find_job_old(void *job_entry, void *key) Link Here
8473
			job_ptr->time_last_active = now;
8476
			job_ptr->time_last_active = now;
8474
			re_kill_job(job_ptr);
8477
			re_kill_job(job_ptr);
8475
		}
8478
		}
8479
		info("job %u not purged, job still completing", job_ptr->job_id);
8476
		return 0;       /* Job still completing */
8480
		return 0;       /* Job still completing */
8477
	}
8481
	}
8478
8482
8479
	if (job_ptr->epilog_running)
8483
	if (job_ptr->epilog_running) {
8484
		info("job %u not purged, EpilogSlurmctld still running", job_ptr->job_id);
8480
		return 0;       /* EpilogSlurmctld still running */
8485
		return 0;       /* EpilogSlurmctld still running */
8486
	}
8481
8487
8482
	if (slurmctld_conf.min_job_age == 0)
8488
	if (slurmctld_conf.min_job_age == 0) {
8489
		info("job %u not purged, no job record purging", job_ptr->job_id);
8483
		return 0;	/* No job record purging */
8490
		return 0;	/* No job record purging */
8491
	}
8484
8492
8485
	min_age  = now - slurmctld_conf.min_job_age;
8493
	min_age  = now - slurmctld_conf.min_job_age;
8486
	if (fed_mgr_is_origin_job(job_ptr) &&
8494
	if (fed_mgr_is_origin_job(job_ptr) &&
8487
	    (job_ptr->end_time > min_age))
8495
	    (job_ptr->end_time > min_age)) {
8496
		info("job %u not purged, too new to purge", job_ptr->job_id);
8488
		return 0;	/* Too new to purge */
8497
		return 0;	/* Too new to purge */
8498
	}
8489
8499
8490
	if (!(IS_JOB_COMPLETED(job_ptr)))
8500
	if (!(IS_JOB_COMPLETED(job_ptr))) {
8501
		info("job %u not purged, job still active", job_ptr->job_id);
8491
		return 0;	/* Job still active */
8502
		return 0;	/* Job still active */
8503
	}
8492
8504
8493
	if (job_ptr->step_list && list_count(job_ptr->step_list)) {
8505
	if (job_ptr->step_list && list_count(job_ptr->step_list)) {
8494
		debug("Job %u still has %d active steps",
8506
		debug("Job %u still has %d active steps",
Lines 8500-8505 static int _list_find_job_old(void *job_entry, void *key) Link Here
8500
		if (job_ptr->array_recs->tot_run_tasks ||
8512
		if (job_ptr->array_recs->tot_run_tasks ||
8501
		    !test_job_array_completed(job_ptr->array_job_id)) {
8513
		    !test_job_array_completed(job_ptr->array_job_id)) {
8502
			/* Some tasks from this job array still active */
8514
			/* Some tasks from this job array still active */
8515
			info("job %u not purged, some tasks from this job array still active",
8516
			     job_ptr->job_id);
8503
			return 0;
8517
			return 0;
8504
		}
8518
		}
8505
	}
8519
	}
Lines 8507-8517 static int _list_find_job_old(void *job_entry, void *key) Link Here
8507
	select_g_select_jobinfo_get(job_ptr->select_jobinfo,
8521
	select_g_select_jobinfo_get(job_ptr->select_jobinfo,
8508
				    SELECT_JOBDATA_CLEANING,
8522
				    SELECT_JOBDATA_CLEANING,
8509
				    &cleaning);
8523
				    &cleaning);
8510
	if (cleaning)
8524
	if (cleaning) {
8525
		info("job %u not purged, job hasn't finished yet", job_ptr->job_id);
8511
		return 0;      /* Job hasn't finished yet */
8526
		return 0;      /* Job hasn't finished yet */
8527
	}
8512
8528
8513
	if (bb_g_job_test_stage_out(job_ptr) != 1)
8529
	if (bb_g_job_test_stage_out(job_ptr) != 1) {
8530
		info("job %u not purged, stage out in progress", job_ptr->job_id);
8514
		return 0;      /* Stage out in progress */
8531
		return 0;      /* Stage out in progress */
8532
	}
8515
8533
8516
	/* If we don't have a db_index by now and we are running with
8534
	/* If we don't have a db_index by now and we are running with
8517
	 * the slurmdbd, lets put it on the list to be handled later
8535
	 * the slurmdbd, lets put it on the list to be handled later
Lines 8521-8526 static int _list_find_job_old(void *job_entry, void *key) Link Here
8521
	if (with_slurmdbd && !job_ptr->db_index)
8539
	if (with_slurmdbd && !job_ptr->db_index)
8522
		jobacct_storage_g_job_start(acct_db_conn, job_ptr);
8540
		jobacct_storage_g_job_start(acct_db_conn, job_ptr);
8523
8541
8542
	info("purging job %u", job_ptr->job_id);
8524
	return 1;		/* Purge the job */
8543
	return 1;		/* Purge the job */
8525
}
8544
}
8526
8545

Return to ticket 3763