Skip to content

Let idle reconciler workers wait without a timeout - #4302

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:reconciler-idle-wait
Sep 3, 2026
Merged

Let idle reconciler workers wait without a timeout#4302
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:reconciler-idle-wait

Conversation

@vogella

@vogella vogella commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The background worker of AbstractReconciler used the same timed wait for idling as for debouncing edits, so every open text editor woke its reconciler thread twice a second with nothing to do. The worker now waits untimed while it is clean and keeps the timed wait only after a change, where it lets further edits coalesce; the startup job keeps its initial delay, and the dirty and canceled checks sit under the queue lock that reset() and cancel() notify on, so no wake-up can be lost.

Measured with 100 installed idle reconcilers over 10 seconds, the worker threads went from 2000 voluntary context switches and 55 ms of CPU time to none, while the edit-to-process latency stayed at the configured 500 ms delay.

The steady state also becomes observable from outside: the new AbstractReconciler#isIdle() reports whether the initial process has run, no change waits and no strategy is active. The reconciler job family only covers startup, so tests (JDT's EditorTestHelper among them) so far reflected into BackgroundWorker for this. Three tests cover the change: an idle worker must be in WAITING rather than TIMED_WAITING, uninstalling an idle reconciler must end its thread, and isIdle() must flip at each stage from startup to uninstall.

@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From e634afb43293780bbf27369bffad3cd0e98e61a2 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Mon, 31 Aug 2026 05:32:16 +0000
Subject: [PATCH] Version bump(s) for 4.42 stream


diff --git a/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF b/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF
index ef7567b50e..4efe4bd566 100644
--- a/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jface.text/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jface.text
-Bundle-Version: 3.31.100.qualifier
+Bundle-Version: 3.31.200.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: 
-- 
2.55.0

Further information are available in Common Build Issues - Missing version increments.

@vogella
vogella force-pushed the reconciler-idle-wait branch from 131374d to 9ca0f37 Compare August 31, 2026 05:38
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ± 0     858 suites  ±0   50m 27s ⏱️ - 1m 42s
 8 235 tests +18   7 992 ✅ +18  243 💤 ±0  0 ❌ ±0 
20 574 runs  +18  19 904 ✅ +18  670 💤 ±0  0 ❌ ±0 

Results for commit a428368. ± Comparison against base commit 3e8e23d.

♻️ This comment has been updated with latest results.

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

Optimizes reconciler workers by eliminating periodic wake-ups while idle and exposing idle state.

Changes:

  • Uses untimed waits for clean workers while preserving edit debouncing.
  • Adds AbstractReconciler.isIdle() and lifecycle tests.
  • Advances the bundle version for the new API.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
AbstractReconciler.java Updates worker waiting and adds idle-state API.
AbstractReconcilerTest.java Tests waiting, shutdown, and idle transitions.
MANIFEST.MF Bumps the bundle version to 3.32.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

🟡 Changes recommended

Cancellation and repeated installation races can still report idle while reconciliation is about to run or remains active.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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.

🟢 Approval recommended

The concurrency behavior is well covered; only a minor API documentation clarification remains.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

The background worker of AbstractReconciler used the same timed wait
for idling as for debouncing changes, so every open text editor woke
its reconciler thread twice a second with nothing to do. The worker now
waits untimed while it is clean and keeps the timed wait only after a
change, where it lets further edits coalesce. The startup job keeps its
initial delay. The dirty and canceled checks happen under the queue lock
that reset() and cancel() notify on, so no wake-up can be lost.

Measured with 100 installed idle reconcilers over 10 seconds, the
worker threads went from 2000 voluntary context switches and 55 ms of
CPU time to none, while the edit-to-process latency stayed at the
configured 500 ms delay in both versions.

The steady state also becomes observable: the new AbstractReconciler
isIdle() reports whether the initial process has run, no change waits
and no strategy is active, which is what tests so far reflected into
BackgroundWorker for. The reconciler job family only covers startup.
Workers canceled by uninstall() stay tracked until their strategy has
returned, and a worker only enters a strategy under the lock that
cancel() takes, so isIdle() never reports idle while process() still
runs or is about to run.

Tests cover this: an idle worker must be in WAITING rather than
TIMED_WAITING, uninstalling an idle reconciler must end its thread,
isIdle() must flip at each stage from startup to uninstall, and it must
stay false after an uninstall during process() or initialProcess(),
also when a later install and uninstall have happened since.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the reconciler-idle-wait branch from 244b2ec to a428368 Compare September 3, 2026 05:37
@vogella
vogella merged commit 44ebb5c into eclipse-platform:master Sep 3, 2026
18 checks passed
@vogella
vogella deleted the reconciler-idle-wait branch September 3, 2026 07:08
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.

3 participants