Skip to content

Fix: model evaluation progress bar timer#5060

Closed
treysp wants to merge 1 commit intomainfrom
trey/eval-prog-bar-timer
Closed

Fix: model evaluation progress bar timer#5060
treysp wants to merge 1 commit intomainfrom
trey/eval-prog-bar-timer

Conversation

@treysp
Copy link
Contributor

@treysp treysp commented Jul 29, 2025

In the Terminal console, a progress bar is displayed when SQLMesh is evaluating models.

The bar includes elapsed time over all models being evaluated, but in some scenarios that timer resets before all models had been evaluated.

The cause of the timer reset was:

  • The start_evaluation_progress method creates the progress bar and assigns the "task" containing the timer. The task is assigned a TaskID that is stored in a console instance field for later usage.
  • The update_snapshot_evaluation_progress method incrementally updates the progress bar as model evaluations complete. That includes updating the task containing the timer, which requires the Task ID stored previously.
  • In the update method, our code defends against a missing Task ID by providing TaskID(0) instead. It appears that this fallback resets the timer, even if the originally assigned task ID was 0.
  • It is not totally clear why update would be called without a task ID assigned - possibly a race condition across threads?

This PR fixes that issue by conditioning the update call on the existence of a progress bar task ID.

@treysp treysp force-pushed the trey/eval-prog-bar-timer branch from d4b36ff to 85d0ed1 Compare July 29, 2025 17:22
@treysp treysp marked this pull request as draft July 29, 2025 17:35
@treysp treysp closed this Jul 29, 2025
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