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

An interrupted thread can't load new classes #431

Open
VidTu opened this issue May 19, 2024 · 1 comment
Open

An interrupted thread can't load new classes #431

VidTu opened this issue May 19, 2024 · 1 comment
Labels
bug something isn't working

Comments

@VidTu
Copy link

VidTu commented May 19, 2024

a simple mod consisting of two classes (shown below) won't be able to load new classes if the current thread is interrupted. this does NOT happen on fabric. an interrupted thread should not do anything by design, but additional class-loading may still occur in rare cases. tested on quilt loader 0.25.0, 0.26.0-beta.1 (where the bug exists) and fabric 0.15.11 (where the bug does not exist). a -Dloader.workaround.jar_copy_all_mods=true JVM flag makes everything work once again.

Main class:

package test.test;

import net.fabricmc.api.ModInitializer;

public class TestMod implements ModInitializer {
    @Override
    public void onInitialize() {
        new Thread(() -> {
            try {
                System.out.println("Interrupting...");
                Thread.currentThread().interrupt();
                System.out.println("Loading...");
                ExampleClass object = new ExampleClass();
                System.out.println("Success.");
            } catch (Throwable t) {
                t.printStackTrace();
                System.exit(-1);
            }
        }).start();
    }
}

Additional stub class:

package test.test;

public class ExampleClass {
    // Stub
}

(P.S. Yes, this issue was edited, because I've deleted my old repository with the code)

@AlexIIL
Copy link
Contributor

AlexIIL commented May 19, 2024

Similar to #339, but will need a slightly different fix.

@ix0rai ix0rai added the bug something isn't working label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants