Skip to content

Improve update check#972

Merged
gniftygnome merged 2 commits intoTerraformersMC:26.1from
litetex:improve-update-check
Mar 24, 2026
Merged

Improve update check#972
gniftygnome merged 2 commits intoTerraformersMC:26.1from
litetex:improve-update-check

Conversation

@litetex
Copy link
Copy Markdown
Contributor

@litetex litetex commented Jan 22, 2026

This should address 2 problems from #953 (comment)

  1. Use the non-critical/download IO Thread pool to start the overall update process (checkForUpdates0)
  2. Don't wait for all started update checks in checkForUpdates0 to finish - This is not needed and just blocks the underlying thread

It might also be helpful to backport these changes

As the version resolution is not critical it's likely better to have it here.

The previously used `backgroundExecutor` is used for internal resource reloading during game initialization which can cause it to get stuck when the download hangs (e.g. when using 3rd party mods that modify resource reloading like Continuity)
@litetex litetex force-pushed the improve-update-check branch from 3567809 to 7d8cb9d Compare January 22, 2026 20:06
@gniftygnome
Copy link
Copy Markdown
Contributor

Frankly, I am not as clear as I would like to be on how this works, and lacking in time to understand it. However, now is the time for some risks since we are still very alpha for 26.1. I am going to merge it and deal with whatever happens later when it happens.

@gniftygnome gniftygnome merged commit b543e6c into TerraformersMC:26.1 Mar 24, 2026
1 check passed
@litetex
Copy link
Copy Markdown
Contributor Author

litetex commented Mar 25, 2026

Frankly, I am not as clear as I would like to be on how this works, and lacking in time to understand it.

Uhm it works by 1. using a different thread pool and 2. not calling the blocking close method but using the non-blocking shutdown instead. That's the PR in a nutshell xD

@litetex litetex deleted the improve-update-check branch March 25, 2026 19:42
@gniftygnome
Copy link
Copy Markdown
Contributor

Uhm it works by 1. using a different thread pool and 2. not calling the blocking close method but using the non-blocking shutdown instead. That's the PR in a nutshell xD

That's a functional description of the changes, which are more extensive than that description might lead a person to expect. A standard try-with-resources which wrapped the entire function is replaced with a different approach. Also while you may know the purpose and function of the various thread pools, to somebody who does not it is quite opaque. My comment merely indicated I had to take it on faith this new implementation is correct and that if it isn't, hopefully that will come to light during the alpha stage of ModMenu for 26.1. If I backport it, that will be after it's been in 26.1 long enough I'm comfortable it's not introducing new bugs.

@gniftygnome
Copy link
Copy Markdown
Contributor

And #1016 is a pretty good example of the kind of thing I was generally concerned about. :)

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.

2 participants