Quark Oddities

Quark Oddities

22M Downloads

Option for disable load patreon information?

10935336 opened this issue · 4 comments

commented

Sorry to raise such a question. My server is located in China, for some reasons, China cannot access patreon normally.
And it will cause the server to be stuck for 4 minutes every time I start the server, which is very sad.

Could you add an option to disable load patreon information please? it will be great.

Quark Version1: Quark-r1.6-179
Quark Version2: Quark-r2.4-311

[12:01:05] [AstralSorcery Patreon Effect Loader/INFO] [Astral Sorcery/]: Patreon effect loading finished.
[12:03:12] [Quark Contributor Loading Thread/ERROR] [quark/]: Failed to load patreon information
>java.net.ConnectException: 连接超时
at sun.nio.ch.Net.connect0(Native Method) ~[?:?] {}
at sun.nio.ch.Net.connect(Net.java:574) ~[?:?] {}
at sun.nio.ch.Net.connect(Net.java:563) ~[?:?] {}
at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588) ~[?:?] {}
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333) ~[?:?] {}
at java.net.Socket.connect(Socket.java:648) ~[?:?] {}
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:290) ~[?:?] {}
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:?] {}
at sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[?:?] {}
at sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[?:?] {}
at sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[?:?] {}
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265) ~[?:?] {}
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372) ~[?:?] {}
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:189) ~[?:?] {}
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1194) ~[?:?] {}
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1082) ~[?:?] {}
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:175) ~[?:?] {}
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1600) ~[?:?] {}
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1528) ~[?:?] {}
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) ~[?:?] {}
at java.net.URL.openStream(URL.java:1167) ~[?:?] {}
at vazkii.quark.base.handler.ContributorRewardHandler$ThreadContributorListLoader.run(ContributorRewardHandler.java:143) [quark:r2.4-311] {re:classloading}
[12:05:47] [main/WARN] [ne.mi.co.ForgeHooks/]: Called deprecated GlobalEntityTypeAttributes#put for betterendforge:end_fish, use EntityAttributeCreationEvent instead.
commented

@SGK2401 I was able to reproduce your issue on manjaro linux with

java 21.0.2 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

However, when running a stripped down version of the code from https://github.com/VazkiiMods/Quark/blob/release-1.19.2-3.4-418/src/main/java/vazkii/quark/base/handler/ContributorRewardHandler.java#L126-L139, I wasn't able to reproduce with just java <file>.java, I had to deliberately add -Djava.net.preferIPv6Addresses=system, which is present in the libraries/net/minecraftforge/forge/1.19.2-43.3.5/unix_args.txt file.

I believe this stems from the fact that raw.githubusercontent.com doesn't really have ipv6 support there, so it just fails.

You can test this out yourself if you have an ipv6 enabled client and try to run

// https://raw.githubusercontent.com/VazkiiMods/Quark/master/contributors.properties

import java.net.URL;
import java.net.URLConnection;
import java.io.InputStreamReader;
import java.util.Properties;
import java.io.IOException;

class temp {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://raw.githubusercontent.com/VazkiiMods/Quark/master/contributors.properties");
            URLConnection conn = url.openConnection();
            conn.setConnectTimeout(10*1000);
            conn.setReadTimeout(10*1000);

            Properties patreonTiers = new Properties();
            try (InputStreamReader reader = new InputStreamReader(conn.getInputStream())) {
                patreonTiers.load(reader);
            }
            System.out.println(patreonTiers);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

with the command java -Djava.net.preferIPv6Addresses=system <file>.java.

Setting preferIPv6Addresses to false can resolve the issue. I do not know if there will be any downsides to doing so.

A potential workaround for quark might be to have a secondary url backup like on pastebin or somewhere that has ipv6 compatibility and trying that if githubusercontent.com fails?

Edit: Nvm, it seems it was a temporary issue somewhere with ipv6 on my network. IPv6 works now, so it works even with -Djava.net.preferIPv6Addresses=system. So it's resolved for me.

commented

This shouldn't stall the server at all, it's loading on a separate thread.

It is indeed an issue if you are running with linux, or at least it is the case happening on me. There isn't any issue while loading the mod on Windows though, so I assume this issue is related to linux threading stuffs. I also have been using the screen function for conveinence, but running it without screen will still cause that jamming.
Also (even though not related) there is this same issue with supplemantaries mod.

Linux Ubuntu 22.04.2 with GUI, using ssh
Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing) Oracle JRE
Using Quark-3.4-418, with modpack SteamPunk v21.5

commented

This shouldn't stall the server at all, it's loading on a separate thread.

It is indeed an issue if you are running with linux, or at least it is the case happening on me. There isn't any issue while loading the mod on Windows though, so I assume this issue is related to linux threading stuffs. I also have been using the screen function for conveinence, but running it without screen will still cause that jamming. Also (even though not related) there is this same issue with supplemantaries mod.

Linux Ubuntu 22.04.2 with GUI, using ssh Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing) Oracle JRE Using Quark-3.4-418, with modpack SteamPunk v21.5

Please dont necro 3 year old issues, also this is likely a issue with your JRE or linux distro as i cannot reproduce this myself on arch with JDK 17, latest 1.20.1 RC also keep in mind we do not backport and threads do not work how you think they do, everything on another thread will never block the main thread so this is likely either a issue with your distro, JRE or another mod

commented

This shouldn't stall the server at all, it's loading on a separate thread.