CC007 / HeadsPluginAPI

The documentation and wiki for the HeadsPluginAPI plugin
MIT License
5 stars 0 forks source link

Updating categories on startup takes too long, causing issues for the server #6

Closed CC007 closed 4 years ago

CC007 commented 4 years ago

At the moment the during startup all categories that need an update are scheduled to be updated at the same time. This causes issues for the server so that it can't keep up. One of the users reported the following:

[K[18:05:24 ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - git-Paper-24 (MC: 1.16.1) ---
[K[18:05:24 ERROR]: The server has not responded for 25 seconds! Creating thread dump
[K[18:05:24 ERROR]: ------------------------------
[K[18:05:24 ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[K[18:05:24 ERROR]: ------------------------------
[K[18:05:24 ERROR]: Current Thread: Server thread
[K[18:05:24 ERROR]: PID: 18 | Suspended: false | Native: true | State: RUNNABLE
[K[18:05:24 ERROR]: Stack:
[K[18:05:24 ERROR]: java.base@11.0.7/java.net.SocketInputStream.socketRead0(Native Method)
[K[18:05:24 ERROR]: java.base@11.0.7/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
[K[18:05:24 ERROR]: java.base@11.0.7/java.net.SocketInputStream.read(SocketInputStream.java:168)
[K[18:05:24 ERROR]: java.base@11.0.7/java.net.SocketInputStream.read(SocketInputStream.java:140)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:448)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:68)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1096)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:816)
[K[18:05:24 ERROR]: java.base@11.0.7/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
[K[18:05:24 ERROR]: java.base@11.0.7/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
[K[18:05:24 ERROR]: java.base@11.0.7/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:754)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1610)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
[K[18:05:24 ERROR]: java.base@11.0.7/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
[K[18:05:24 ERROR]: java.base@11.0.7/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:33

While I believe by default the server waits 60 seconds before giving this error, it is of course not the case that the plugin should cause such a long delay.

Therefore it would be best if the update of each category is staggered, just like how category updates are staggered if you use the /hpa update all command.