Skip to content

Remove disabled taps from smart scheduling - #166

Merged
naomiwise merged 4 commits into
mainfrom
skip-disabled-schedules
Jul 2, 2026
Merged

Remove disabled taps from smart scheduling #166
naomiwise merged 4 commits into
mainfrom
skip-disabled-schedules

Conversation

@naomiwise

@naomiwise naomiwise commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Context

Disabled taps are currently being included in the smart scheduling and when a schedule gets moved onto another node via spread_schedules it retains it's smart_interval_mask which was calculated on the previous nodes activity.

Also modifies the evaluation slightly to model the average schedule profile of a schedule better which typically has increased CPU usage in the first minute.
Screenshot 2026-07-02 at 15 18 28

Checklist

@naomiwise
naomiwise requested a review from a team as a code owner July 2, 2026 10:38
Copilot AI review requested due to automatic review settings July 2, 2026 10:38
@platon-github-app-production

Copy link
Copy Markdown

Comment /request-review to automatically request reviews from the following teams:

You can also request review from a specific team by commenting /request-review team-name, or you can add a description with --notes "<message>"

💡 If you see something that doesn't look right, check the configuration guide.

@wise-github-bot-app

Copy link
Copy Markdown

This is currently a non-blocking check, and it will not prevent your Pull Request from being merged.

The CODEOWNER of this repository has some untagged assets.

As this is a public repository, asset details will not be shown.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Changes: Bugfix (2), Maintenance (1)

This PR aims to prevent disabled schedules (“taps”) from being considered in smart scheduling calculations and to avoid retaining a stale smart_interval_mask when schedules are moved between nodes via spread_schedules.

Changes:

  • Skip disabled schedules when building schedule objects for smart scheduling.
  • Reset smart_interval_mask when spreading schedules to a different server.
  • Bump package version to 0.10.2 and document the changes in the changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
setup.py Bumps the package version to 0.10.2.
cicada/commands/spread_schedules.py Attempts to reset smart_interval_mask during schedule spreading (currently needs a DB-level NULL update to actually take effect).
cicada/commands/smart_schedule.py Skips disabled schedules when constructing Schedule objects for optimisation.
CHANGELOG.md Adds a 0.10.2 entry describing the intended behavior changes.
Comments suppressed due to low confidence (1)

cicada/commands/spread_schedules.py:103

  • new_schedule_details["smart_interval_mask"] = None does not actually reset the value in the database: scheduler.update_schedule_details() never updates smart_interval_mask, and its update logic generally skips None values. As a result, spread_schedules will retain the previous node’s smart_interval_mask even after reassignment.

A simple fix is to explicitly set the DB column to NULL in the commit path (or extend the scheduler helper to support this field).

        new_schedule_details["smart_interval_mask"] = None  # Reset smart_interval_mask to None when spreading schedules

        next_enabled_server += 1
        if next_enabled_server == valid_server_count:
            next_enabled_server = 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cicada/commands/spread_schedules.py
Comment thread cicada/commands/smart_schedule.py Outdated
Comment thread cicada/commands/smart_schedule.py Outdated
teaf-wise
teaf-wise previously approved these changes Jul 2, 2026
@wise-github-bot-app

Copy link
Copy Markdown

🟡

Approvals from users who have not completed the mandatory secure code training will be rejected in 4 day(s).

The following approver(s) still need to complete it:

amofakhar
amofakhar previously approved these changes Jul 2, 2026
@naomiwise
naomiwise dismissed stale reviews from amofakhar and teaf-wise via de855ec July 2, 2026 14:13
@naomiwise
naomiwise force-pushed the skip-disabled-schedules branch from de855ec to cbeb00e Compare July 2, 2026 14:16
CountryTk
CountryTk previously approved these changes Jul 2, 2026
Comment thread cicada/commands/smart_schedule.py Outdated
Comment thread tests/test_smart_scheduling.py
@naomiwise
naomiwise merged commit 4f14e26 into main Jul 2, 2026
5 of 8 checks passed
@naomiwise
naomiwise deleted the skip-disabled-schedules branch July 2, 2026 15:12
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.

5 participants