cannot push because UI is detached

Hi all,

Lately I’ve been getting an exception in my code but it is only thrown sometimes when I try to make a push to the UI.

UI.getCurrent( ).access( ( ) →
UI.getCurrent( ).push( );

at com.vaadin.ui.UI.access(…)
at …

Apparently it’s telling that the UI is no longer attached to a VaadinSession. Can it be either because UI’s not alive or session doesn’t exist anymore? I mean basically my questions are:

Why am I getting the exception, why is the UI getting detached?
i.e. What causes the UI to be detached, since I’ve been reading that UIs are open on the client side and send a regular heartbeat to the server to indicate they are still alive, even though there is no ongoing user interaction.
And my session is NOT configured to timeout (default behaviour).

How can I treat it? (even if the cause can’t be determined). Since my process goes on executing on the background, but my UI is dead, how can I restore it, or attach it to the session.

Any ideas?


Pd. I can copypaste specific parts of my code if it helps