-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty: IllegalStateException on WebSocket connection lost #20783
Comments
What Jetty version are you using? Do you have custom configuration for Jetty SessionCache or SessionDataStore? |
Looking at the code, it seems the HTTP session gets invalidated right after VaadinSession session = null;
try {
session = service.findVaadinSession(vaadinRequest); // <----- Gets VaadinSession from HTTP session
} catch (SessionExpiredException e) {
....
return session;
}
UI ui;
session.lock();
try {
VaadinSession.setCurrent(session);
ui = service.findUI(vaadinRequest); // <----- Failure is caused by this calls When |
Currently, I cannot see a way to handle this exception, other than suppressing the log in |
Description of the bug
We get the following errors:
Apparently, when the web socket is closed or loses connection, it tries to find the associated Vaadin UI instance. But if the underlying session has been closed already, the getAttribute method throws this exception.
It has probably something to do with us manually calling
vaadinSession.getSession().invalidate()
.Expected behavior
There should not be an exception when the web socket is closed.
Minimal reproducible example
I haven't been able to reproduce this yet. I've tried creating a button with a click listener that calls
vaadinSession.getSession().invalidate()
and waiting until the web socket is closed, but that alone doesn't seem to be enough.Versions
OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: