Skip to content

Commit b40718c

Browse files
committed
fix: decreasing job query verbosity
1 parent cb6124b commit b40718c

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

snakemake_executor_plugin_slurm/__init__.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -701,30 +701,39 @@ async def check_active_jobs(
701701
status_command
702702
)
703703
if status_of_jobs is None and sacct_query_duration is None:
704-
self.logger.debug(f"could not check status of job {self.run_uuid}")
704+
is_final_attempt = i + 1 == status_attempts
705+
self.logger.debug(
706+
f"could not check status of job {self.run_uuid}"
707+
+ (" (final attempt)" if is_final_attempt else "")
708+
)
705709
continue
706710
sacct_query_durations.append(sacct_query_duration)
707-
self.logger.debug(f"status_of_jobs after sacct is: {status_of_jobs}")
708711
# only take jobs that are still active
709712
active_jobs_ids_with_current_sacct_status = (
710713
set(status_of_jobs.keys()) & active_jobs_ids
711714
)
712-
self.logger.debug(
713-
f"active_jobs_ids_with_current_sacct_status are: "
714-
f"{active_jobs_ids_with_current_sacct_status}"
715-
)
716-
active_jobs_seen_by_sacct = (
717-
active_jobs_seen_by_sacct
718-
| active_jobs_ids_with_current_sacct_status
719-
)
720-
self.logger.debug(
721-
"active_jobs_seen_by_sacct are: " f"{active_jobs_seen_by_sacct}"
722-
)
723715
missing_sacct_status = (
724716
active_jobs_seen_by_sacct
725717
- active_jobs_ids_with_current_sacct_status
726718
)
727-
self.logger.debug(f"missing_sacct_status are: {missing_sacct_status}")
719+
# Only log detailed debug info on final attempt or when complete.
720+
# This avoids log flooding in verbose mode.
721+
if not missing_sacct_status or i + 1 == status_attempts:
722+
self.logger.debug(
723+
f"active_jobs_ids_with_current_sacct_status are: "
724+
f"{active_jobs_ids_with_current_sacct_status}"
725+
)
726+
active_jobs_seen_by_sacct = (
727+
active_jobs_seen_by_sacct
728+
| active_jobs_ids_with_current_sacct_status
729+
)
730+
self.logger.debug(
731+
"active_jobs_seen_by_sacct are: "
732+
f"{active_jobs_seen_by_sacct}"
733+
)
734+
self.logger.debug(
735+
f"missing_sacct_status are: {missing_sacct_status}"
736+
)
728737
if not missing_sacct_status:
729738
break
730739

0 commit comments

Comments
 (0)