Push fail freezes the UI

Hi All,
while I’m using the UI it randomly freezes (every widget displayed is turned into DISABLED state).
Checking the chrome console seems that a push fail leads to this:

From the last lines seems that the client engine is going to show the message “Take not of the unsaved data…” but nothing happens due to this severe “Response didn’t contain a server id”.

Which could be the reason?
Thanks in advance.

What Middleware are you using? Tomcat?

Anything interesting in the servlet logs?

I’m using Tomcat 7.0.68 and unluckily no interesting logs.
I googled the error “Response didn’t contain a server id.” and it seems related to the fact that maybe I’m not managing well the UIs since I’ve implemented that a Session with multiple UIs should share the same widgets. This idea should optimize the memory consumption but maybe I’m not considering something.

When you say widgets, are you talking about Vaadin UI controls?

Multiple UI’s can’t share the same controls :frowning:

Yes, grids, buttons, etc… I was imagine something like this, I’ll modify the code and let you know.

Nothing to do, I changed the code in the way that all the new UIs will have new controls but still I’ve the same above error.

Hi again Big-Vienna, are you doing some kind of Threading in your UI, that the controls might be touched by a Thread other than the Vaadin UI Thread?

Yes I’ve a background thread that treats part of the logic but all the changes to the UI controls are made into access() methods.

Are you sharing some kind of Container that the UI Controls use, between multiple threads or UIs?

No there’s just one background thread that receives events with an EventBus but all the UI elements are modified by access() methods, as I’ve already mentioned.

The interesting things is that I discovered that the UI blocks because the instance is normally detached by Vaadin after about 15 minutes. The default heartbeat interval is 5 minutes and after three fails (15 minutes) the UI is detached,

Could be this the problem? What I can’t conceive is that the interactions with buttons and other elements works correctly.

Any ideas?
I understood that the “Response didn’t contain an id” is a communication problem and it can be related to wrong use of the controls but I fixed the way I manage the UIs and I’ve still the error. It’s strange that anyway the top bar with the message “Communication problem” should appear but it’s not.

Is it possible that even if I make actions on the UI Vaadin detaches it even if there are no heartbeats?

Up

UP up up

And up

Can you share some code?

Uhm, not really, it’s a big application but I can make you a summary.
I use the last version of Tomcat 7 combined with Servlet 3.0, the login part is managed by Spring Security.
I’ve a background thread that loads (before the start of Vaadin) all the UI components needed by the interface.
When a user requests the app this background thread makes a copy of the widgets and gives them to Vaadin to attach them to the UI.

I hope that the creation of Components in a background thread is not a problem, every change made on Components that are attached are made in access() methods.

The problem is that after 15-20 mins that the UI runs on the browser Vaadin shows the above errors and call the detach() on the UI. It looks like the UI is normally deprecated but no message appears.
I checked the properties of Tomcat and the session has a timeout of 30 minutes.
I hope that the problem is not related to the sessions of Spring Security but it seems strange.

I use the Push in manual mode and I call all the ui.push() inside access() methods.

I’ts hard to figure out without some code :slight_smile:

What do you mean when you say “makes a copy of the widgets”? Are you creating new instances of all components?
How do you attach them to the UI on user request?

I use a serialization/deserialization to make a fast and deep copy of the cached UI component.
It’s a specular copy so a totally brand new instance.

Then the home page that is a Panel with a VerticalLayout call the method addComponent() of the layout.
Everything is done in an access method:

[code]
ui.access(new Runnable() {
@Override
public void run() {
try {

        home.appendChildAt(component, 1);
        
    } catch (Exception e) {
        logger.error(...);
    }
    
    ui.push();
}

});
[/code]The appendChildAt() method simply call the addComponent:

verticalLayout.addComponent(component, position);

It’s very strange…
Can you try to set log level to FINEST for VaadinService in order to trace closing of uis and sessions?