From 0e25d1aaaad93c76637d490ea381d0e0786ca9e3 Mon Sep 17 00:00:00 2001 From: Hilary Oliver Date: Mon, 2 Sep 2024 15:34:43 +1200 Subject: [PATCH] First hack at a dupl job submission fix. --- cylc/flow/subprocpool.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cylc/flow/subprocpool.py b/cylc/flow/subprocpool.py index 864071332b8..2eeb880afe3 100644 --- a/cylc/flow/subprocpool.py +++ b/cylc/flow/subprocpool.py @@ -348,12 +348,17 @@ def put_command( callback_255=callback_255, callback_255_args=callback_255_args ) else: - self.queuings.append( - [ - ctx, bad_hosts, callback, callback_args, - callback_255, callback_255_args - ] - ) + if ( + not any(iq[0].cmd == ctx.cmd for iq in self.queuings) and + not any(ir[1].cmd == ctx.cmd for ir in self.runnings) + ): + # Queue it if not already queued or running. + self.queuings.append( + [ + ctx, bad_hosts, callback, callback_args, + callback_255, callback_255_args + ] + ) @classmethod def run_command(cls, ctx):