Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make task executor lifecycled to platform readiness. #2715

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

wizjany
Copy link
Collaborator

@wizjany wizjany commented Feb 17, 2025

Closes #2459.

Note that the platform list (now map) was/is not threadsafe, which in theory might be problematic if platforms throw ready/unready in multiple threads. Ready/unready should be fixed by #2571 if this is an issue.

@wizjany wizjany marked this pull request as ready for review March 2, 2025 17:23
@wizjany wizjany requested a review from a team as a code owner March 2, 2025 17:23
@wizjany
Copy link
Collaborator Author

wizjany commented Mar 2, 2025

This is now tested on Fabric, Neoforge, and Bukkit; client and server.

Notably, the schematic tasks don't actually listen to interrupts, so a long-running schematic load in single player will actually run to completion when closing a world and loading back into it (or another). However, the running schematic task doesn't affect the new world as the actor/session/etc. is no longer in use. It also doesn't prevent server shutdowns as the executor is no longer waiting for task completion.

Looking at the original comments, it seems there was some concern about a timer thread, but it doesn't seem to be causing any issues. I verified that this change does actually fix the issue by commenting out the executor shutdown call and watching the server not shut down.

@wizjany wizjany merged commit f67f649 into version/7.3.x Mar 3, 2025
5 checks passed
@wizjany wizjany deleted the fix/executor-shutdown branch March 3, 2025 14:23
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.

Fabric with worldedit hangs when stopping during shutdown
2 participants