Skip to content

Conversation

@jonahgraham
Copy link
Contributor

Each use of a timer creates a User Object in Windows, and once we have stopped waiting for our desired event we don't need the cancellation tracking anymore.

If there are lots of calls to processOSMessagesUntil, such as repeated browser.setText within the MAXIMUM_OPERATION_TIME (5 second) window, we can end up with a huge growth in the number of User Objects, leading to potential SWTError: No more handles errors elsewhere in the client code.

Fixes #2806

@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2025

Test Results

  147 files  ±0    147 suites  ±0   22m 13s ⏱️ + 1m 23s
4 667 tests +2  4 645 ✅ +2  22 💤 ±0  0 ❌ ±0 
  408 runs  ±0    403 ✅ ±0   5 💤 ±0  0 ❌ ±0 

Results for commit 1551973. ± Comparison against base commit 7ad0a96.

♻️ This comment has been updated with latest results.

@jonahgraham
Copy link
Contributor Author

@HeikoKlare I don't know how to automate a regression test for this, I assume the existing test cases will cover it sufficiently.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Thank you for the catch, @jonahgraham!
The change sounds totally reasonable to me. I agree that we probably don't need an additional regression test for this. Still, what about just adding a test that basically consists of your snippet from #2806 followed by a control creation to ensure that no "no more handles" error occurs?
I.e., something like:

for (int i = 0; i < 20000; i++) {
	browser.setText("Iteration " + i);
	new BrowserFunction(browser, "name");
}
new Composite(shell, SWT.NONE);

@jonahgraham
Copy link
Contributor Author

I.e., something like:

Done.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Great, thank you!

Each use of a timer creates a User Object in Windows, and once we
have stopped waiting for our desired event we don't need the cancellation
tracking anymore.

If there are lots of calls to processOSMessagesUntil, such as repeated
browser.setText within the MAXIMUM_OPERATION_TIME (5 second) window,
we can end up with a huge growth in the number of User Objects, leading
to potential `SWTError: No more handles` errors elsewhere in the client
code.

Fixes eclipse-platform#2806
@jonahgraham jonahgraham merged commit 598ecd7 into eclipse-platform:master Dec 3, 2025
18 checks passed
@jonahgraham jonahgraham deleted the edge-fix branch December 3, 2025 15:04
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.

Edge integration leaves unused Timers around

2 participants