Skip to content

Avoid 0ms interval rescheduling in configuration service #259524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

Fixes #259517

This change prevents an infinite loop of immediate scheduler execution when ASSIGNMENT_REFETCH_INTERVAL is set to 0 (meaning no polling should occur).

Problem

The ConfigurationDefaultOverridesContribution class was unconditionally rescheduling its experimental settings scheduler, even when ASSIGNMENT_REFETCH_INTERVAL was set to 0. This caused:

  • Infinite loop of immediate scheduler execution
  • Potential performance issues
  • Unbounded queuing of experimental settings processing

Solution

Added a conditional check before rescheduling the scheduler:

this.autoRefetchExperimentalSettingsScheduler = new RunOnceScheduler(() => {
    this.processExperimentalSettings(this.autoRefetchExperimentalSettings, true);
    if (ASSIGNMENT_REFETCH_INTERVAL !== 0) {
        // TODO@sandy081 wait for the promise returned by processExperimentalSettings to avoid unbounded queuing
        this.autoRefetchExperimentalSettingsScheduler.schedule();
    }
}, ASSIGNMENT_REFETCH_INTERVAL);

When ASSIGNMENT_REFETCH_INTERVAL is 0, the scheduler will run once but won't reschedule itself, properly implementing the "no polling" behavior.

Cherry-picked from commit d38eb0f by @hediet.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Cherry-pick d38eb0f from PR #259518.

Avoid 0ms interval rescheduling in ConfigurationDefaultOverridesContribution.
When ASSIGNMENT_REFETCH_INTERVAL is 0, skip rescheduling to prevent
infinite loop of immediate scheduler execution.

Co-authored-by: hediet <[email protected]>
@Copilot Copilot AI changed the title [WIP] Cherry-pick commit from PR #259518 to main Avoid 0ms interval rescheduling in configuration service Aug 4, 2025
@Copilot Copilot AI requested a review from hediet August 4, 2025 11:36
Copilot finished work on behalf of hediet August 4, 2025 11:36
@hediet hediet marked this pull request as ready for review August 4, 2025 11:45
@hediet hediet enabled auto-merge (squash) August 4, 2025 11:46
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 4, 2025
@hediet hediet merged commit 9ace93e into main Aug 5, 2025
18 checks passed
@hediet hediet deleted the copilot/fix-3749e9ce-cfc0-402e-9cd6-8db60bfec54c branch August 5, 2025 09:33
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.

Avoid 0ms interval
4 participants