Clone
Marcin Cieslak
committed
on 14 Jul 22
LDEV-5083 Prevent WF from freezing on shutdown because of unclosed Flux
Open Fluxes prevent WF from shutting down as they are threads not
ma… Show more
LDEV-5083 Prevent WF from freezing on shutdown because of unclosed Flux

Open Fluxes prevent WF from shutting down as they are threads not

managed by the server lifecycle.

Now we force complete Sinks on Spring context destroy. It closes

underlying Flux threads.

The problem is that it occurs when most Spring beans are already

destroyed. Fluxes on close want to emit a signal to front end

subscribers. Spring tries to reinitialise controllers which should send

those signals. It fails as context basically does not exist anymore.

All in all we get some harmless errors on server shutdown.

The way to avoid would be to have more control over Spring bean destroy

order which does not seem easily achievable.

Show less