kstyrc / embedded-redis

Redis embedded server for Java integration testing
863 stars 373 forks source link

Shutdown from redissonclient in spring boot environment leads to excpetions #132

Open stefan-g opened 2 years ago

stefan-g commented 2 years ago

The issue occurs with embedded-redis:0.7.3 (minor version works). The reason is at AbstractRedisInstance#start() the method installExitHook() is called. In spring boot environment the shutdownhook is executed before the destroy method of beans.

In combination with redissonClient this leads to following excptions: [isson-netty-2-4] o.r.c.h.ErrorsLoggingHandler : Exception occured. Channel: [id: 0xebd17019, L:/127.0.0.1:57110 - :localhost/127.0.0.1:6799] java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_232]

It would be good if installExitHook() could be disabled by a config flag