Do not run the InfoTextSwingWorker on the EDT thread #4802
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Fixes #4801
Description of the Change
This changes the data gathering task for Gather Debug Information... to run on a background thread rather than the EDT thread. The dialog as a result now shows the text "Gathering information, please wait..." until the dialog is populated, rather than being blank. The dialog also no longer hangs indefinitely.
The reason we previously got away with running that task on the EDT thread is that
SwingWorker
would always run thedone()
method after the internalFutureTask<>
completes, so theget()
method would have a result to return. But since Java 21, it runsdone()
as part of theFutureTask<>
callback if running on the EDT thread, i.e., it runsdone()
before the task completes. Theget()
call therefore blocks as it has no result yet, and the task is blocked from completing and providing those results.I audited the rest of our
SwingWorker
tasks, but they are all run via.execute()
and thus are safe from this issue. Only one task (RenderPathWorker
) is run in a dfiferent manner, but it is on its own non-EDT executor. One unnecessary usage of that worker was found and removed though.Possible Drawbacks
None
Documentation Notes
N/A
Release Notes
This change is