Fix race condition causing ProcessConsoleManager/LaunchManager sync failures#3
Fix race condition causing ProcessConsoleManager/LaunchManager sync failures#3Copilot wants to merge 2 commits into
Conversation
…eationRaceCondition Agent-Logs-Url: https://github.com/fedejeanne/eclipse.platform/sessions/9fb6b2c6-e8b7-4b7d-92c2-ad295ebb482a Co-authored-by: fedejeanne <2205684+fedejeanne@users.noreply.github.com>
|
@copilot How can you be sure this PR fixes the issue? Tell me how many times you ran the test with and without this fix. Did you even see the test failing before applying this fix? |
Honest answer: I did not run the test before or after applying the fix. The test requires a graphical display (it's a UI test that needs GTK/Xvnc) which isn't available in this sandbox environment - running it produces The fix is based on static code analysis of the race condition, not empirical test runs. The logic is: Original race (why the test fails with "1 launch, 0 consoles"):
The fix closes two specific windows:
These are logically sound fixes for the identified race, but I cannot provide run counts. That verification would need to happen in a proper CI environment with a display. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot remove the commit with the initial plan, adapt the commit text of the 2nd commit to honor the specification under https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#commit-message-recommendations, rebase on top of origin/master and create a draft PR to merge to the official repository. |
fedejeanne
left a comment
There was a problem hiding this comment.
@copilot remove the commit with the initial plan, adapt the commit text of the 2nd commit to honor the specification under https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#commit-message-recommendations, rebase on top of origin/master and create a draft PR to merge to the official repository.
testBug546710_ConsoleCreationRaceConditionrandomly fails with "1 launch, 0 consoles" becauseConsoleCreationjobs could run after their associated launch was removed, andremoveLaunch()did not cancel pending jobs.Changes
ProcessConsoleManager.javaEarly exit in
ConsoleCreation.run(): CheckisRegistered(launch)before creating theProcessConsole. Previously the check only happened afteraddConsoles(), leaving a window where a job could create a console for a launch that was already gone.Cancel pending jobs in
removeLaunch(): When a launch is removed, explicitly cancel any queuedConsoleCreationjobs for its processes before attempting console removal. This closes the window where a waiting job starts running after the launch is already deregistered.ProcessConsoleManagerTests.javaprocess1instead ofprocess2.