Plan icon indicating copy to clipboard operation
Plan copied to clipboard

Logging Exceptions during shutdown fails if exception occurs on a Processing thread

Open AuroraLS3 opened this issue 3 years ago • 0 comments

Describe the issue

Processing threads shut down and cause thread interrupt for IO operations trying to log exception if one occurs during plugin disable

Exceptions & other logs

19:05:12 [SEVERE] helmikuuta 12, 2022 7:05:12 IP. com.djrapitops.plan.utilities.logging.PluginErrorLogger writeNew
SEVERE: Failed to log Plan error, see suppressed.
java.lang.NoClassDefFoundError: com/mysql/cj/exceptions/ExceptionFactory
    ...
    Suppressed: java.nio.channels.ClosedByInterruptException
        at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
        at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:216)
        at java.nio.channels.Channels.writeFullyImpl(Channels.java:78)
        at java.nio.channels.Channels.writeFully(Channels.java:101)
        at java.nio.channels.Channels.access$000(Channels.java:61)
        at java.nio.channels.Channels$1.write(Channels.java:174)
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
        at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:316)
        at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149)
        at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233)
        at java.io.BufferedWriter.close(BufferedWriter.java:266)
        at java.nio.file.Files.write(Files.java:3357)
        at java.nio.file.Files.write(Files.java:3397)
        at com.djrapitops.plan.utilities.logging.PluginErrorLogger.writeNew(PluginErrorLogger.java:229)
        at com.djrapitops.plan.utilities.logging.PluginErrorLogger.logNew(PluginErrorLogger.java:222)
        at com.djrapitops.plan.utilities.logging.PluginErrorLogger.logToFile(PluginErrorLogger.java:112)
        at com.djrapitops.plan.utilities.logging.PluginErrorLogger.log(PluginErrorLogger.java:102)
        at com.djrapitops.plan.utilities.logging.PluginErrorLogger.warn(PluginErrorLogger.java:91)
        at com.djrapitops.plan.processing.Processing.exceptionHandlerNonCritical(Processing.java:113)
        at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836)
        at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:811)
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1609)
        ... 3 more

Plugin versions

DEV version a6fdcc5edddb0129b98638e173d4c0e0357162e9

Additional information

Almost every query and async operation is executed on a processing thread.

AuroraLS3 avatar Feb 12 '22 17:02 AuroraLS3