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

fix hang on shutdown for fabric due to hanging user threads #2460

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class FutureProgressListener implements Runnable {

private static final Timer timer = new Timer();
private static final Timer timer = new Timer(true);
private static final int MESSAGE_DELAY = 1000; // 1 second
private static final int MESSAGE_PERIOD = 10000; // 10 seconds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
Copy link
Member

Choose a reason for hiding this comment

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

This import also seems to be unnecessary, it should be removed

import java.util.stream.Collectors;

import static com.google.common.base.Preconditions.checkNotNull;
Expand Down Expand Up @@ -286,6 +287,7 @@ private void onStopServer(MinecraftServer minecraftServer) {
WorldEdit worldEdit = WorldEdit.getInstance();
worldEdit.getSessionManager().unload();
WorldEdit.getInstance().getEventBus().post(new PlatformUnreadyEvent(platform));
WorldEdit.getInstance().getExecutorService().shutdown();
Copy link
Member

Choose a reason for hiding this comment

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

If this is something that must be shut down on Fabric, I feel that we should probably also shut this down on other platforms.

}

private boolean skipEvents() {
Expand Down