Skip to content

fix: honour executors' maxTasks in ExecutorMind and stop endless reconnection attempts - #8890

Open
chrisburr wants to merge 2 commits into
DIRACGrid:integrationfrom
chrisburr:fix/executormind-maxtasks
Open

chrisburr wants to merge 2 commits into
DIRACGrid:integrationfrom
chrisburr:fix/executormind-maxtasks

Conversation

@chrisburr

Copy link
Copy Markdown
Member

Two bugs in how executors connect to an ExecutorMind (e.g. the OptimizationMind), found while debugging a large job backlog in LHCb production (see #8889).

The Mind ignores maxTasks. Executors send maxTasks when connecting (from the MaxTasks option of their modules). ExecutorMindHandler.conn_connected computes numTasks from it, but then calls addExecutor() without it, so every executor connection gets one task at a time. In production, a profile of an Optimizers executor showed one task being processed at all times while ~68% of its thread-time was idle, and the OptimizationMind was also mostly idle. Throughput was limited to one task in flight per executor process. numTasks is now passed to addExecutor.

This changes behaviour wherever MaxTasks is already configured, since it has been silently ignored until now.

Executors can retry reconnecting forever. When the connection to the Mind drops, ExecutorReactor retries MessageClient.connect() until it succeeds. But MessageClient.sendMessage also reconnects by itself, e.g. when the executor reports a processed task. connect() then returns S_ERROR("Already connected"), and the loop retried every ReconnectSleep seconds forever. In production that showed up as Connect error failed: Already connected every second. The loop now stops once the client is connected, whoever reconnected it.

BEGINRELEASENOTES
*Core
FIX: ExecutorMind sends executors as many tasks at once as their MaxTasks option allows, instead of always one
FIX: Executors no longer keep trying to reconnect to their Mind once the connection has been re-established
ENDRELEASENOTES

@chrisburr
chrisburr marked this pull request as ready for review November 16, 2026 14:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant