refactor: Avoid generics overuse for database - Database sessions - #292
Conversation
4bbb7d7 to
51d0413
Compare
51d0413 to
5f35d9a
Compare
|
Don't see any major issues, though there is one thing we might want to take a closer look at; At lines 153 and 156 in DrunksManagerImpl, we enqueue db tasks in a CompletableFuture#thenAcceptAsync block. I could be wrong here, but I think this could technically run after Database#flush on shutdown if we're unlucky with the timing |
You mean after this line gets called? 🤔 I think one of the requirements for those methods in drunkenstate to be run is that the server is ticking. I basically assume this order of operation for shutdown:
It might be an issue though if "stop server ticking" is run concurently with "disable all plugins", but that might apply to other database objects, as well. Otherwise, this method should handle that, assuming no more database tasks gets submitted after or concurently when that method is called (that's because the executor is single threaded; only one thread is doing operations at the database to avoid corruption) |
Yes |
Ok 😛 |
If that's the case then this issue probably won't exist in practice- If I remember correctly, the tick loop stops before plugins are disabled and between that, there's probably also some time spent saving the world and etc. |
Double Ok :P |
Is there a limit for nested replies? 👀 |
No |
Awesome 😄 |
Perfect way to make it hard to read the actual discussion 😛 |
No description provided.