Do not submit profile lookups to worldgen threads

They block. On network I/O.

If enough tasks are submitted the server will eventually stall
out due to a sync load, as the worldgen threads will be
stalling on profile lookups.
This commit is contained in:
Spottedleaf
2021-08-08 16:26:46 -07:00
parent 8eb7ab6946
commit 40654111d1
4 changed files with 46 additions and 3 deletions

View File

@@ -51,6 +51,15 @@
}
return optional;
@@ -167,7 +169,7 @@
} else {
CompletableFuture<Optional<GameProfile>> completablefuture1 = CompletableFuture.supplyAsync(() -> {
return this.get(username);
- }, Util.backgroundExecutor().forName("getProfile")).whenCompleteAsync((optional, throwable) -> {
+ }, Util.PROFILE_EXECUTOR).whenCompleteAsync((optional, throwable) -> { // Paper - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread
this.requests.remove(username);
}, this.executor);
@@ -208,7 +210,7 @@
label54: