Skip to content

Commit c0550a9

Browse files
thomhurstclaude
andauthored
fix: Throttle scheduler status logs to every 15 seconds (#1681)
Add throttling to high-frequency scheduler status logs: - "Scheduler waiting: Total=X, Queued=X, Executing=X, Completed=X" - "Pending modules: ..." - "Executing modules: ..." These messages previously fired every scheduler loop iteration (~100ms), causing significant log spam in CI. Now they only log once every 15 seconds. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 39875ef commit c0550a9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/ModularPipelines/Engine/ModuleScheduler.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ internal class ModuleScheduler : IModuleScheduler
3535
private readonly CancellationTokenSource _disposalCancellationTokenSource;
3636
private readonly ReaderWriterLockSlim _stateLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
3737

38+
private static readonly TimeSpan StatusLogInterval = TimeSpan.FromSeconds(15);
39+
3840
private bool _schedulerCompleted;
3941
private bool _isDisposed;
42+
private DateTimeOffset _lastStatusLogTime;
4043

4144
public ModuleScheduler(
4245
ILogger logger,
@@ -326,6 +329,14 @@ private bool ShouldExitScheduler(int queuedCount)
326329

327330
private void LogSchedulerWaitingState()
328331
{
332+
var now = _timeProvider.GetUtcNow();
333+
if (now - _lastStatusLogTime < StatusLogInterval)
334+
{
335+
return;
336+
}
337+
338+
_lastStatusLogTime = now;
339+
329340
var stats = _stateQueries.GetStatistics();
330341
_logger.LogDebug(
331342
"Scheduler waiting: Total={Total}, Queued={Queued}, Executing={Executing}, Completed={Completed}, Pending={Pending}",

0 commit comments

Comments
 (0)