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

Async Command List events cannot be filtered / Suggestions are empty, with console error. #16

Open
crashdemons opened this issue Dec 9, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@crashdemons
Copy link
Member

crashdemons commented Dec 9, 2020

a recent Paper change means that duplicate(?) events for PlayerCommandSendEvent are now received, some of which are Async, others Sync.

PR #15 (release 0.20.5) workarounds this issue to only to avoid errors, it does not add support for async command list events - the impacts are not yet well known.

Since this plugin need to checks users permissions (sync required) and it also needs to fillter the current commands before returing (current async thread), there may not be a good fix if async command-list events become the standard.

The plugin cannot defer to a sync thread to do this task because the only chance to modify the list is in the current event call. The event cannot be forced to wait for the sync operation to complete either (really bad idea) or the server will deadlock. The only way I see that you could fix this is if you pre-fetched all of the permissions and config values prior to the commands event - but since these occur within the same tick as login, this may prove difficult.

Relevant server log

[08.12 17:08:55] [Server] [WARN] Exception in thread "ForkJoinPool.commonPool-worker-12" java.lang.NoClassDefFoundError: Could not initialize class com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent
[08.12 17:08:55] [Server] [WARN] 	at net.minecraft.server.v1_16_R3.CommandDispatcher.sendAsync(CommandDispatcher.java:273)
[08.12 17:08:55] [Server] [WARN] 	at net.minecraft.server.v1_16_R3.CommandDispatcher.lambda$a$4(CommandDispatcher.java:249)
[08.12 17:08:55] [Server] [WARN] 	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
[08.12 17:08:55] [Server] [WARN] 	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[08.12 17:08:55] [Server] [WARN] 	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067)
[08.12 17:08:55] [Server] [WARN] 	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703)
[08.12 17:08:55] [Server] [WARN] 	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172)

Paper-1.16.4 build 318

@crashdemons crashdemons added the bug Something isn't working label Dec 9, 2020
@crashdemons crashdemons changed the title Async Command List events cannot be filtered Async Command List events cannot be filtered / Suggestions are empty, with console error. Dec 9, 2020
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

1 participant