Skip to content
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

Active UIThreads cause Jetty server shutdown to hang #241

Open
kysmith-csg opened this issue Oct 16, 2024 · 0 comments
Open

Active UIThreads cause Jetty server shutdown to hang #241

kysmith-csg opened this issue Oct 16, 2024 · 0 comments

Comments

@kysmith-csg
Copy link
Contributor

This seems to be the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=360630 which is a very old bug, but we are encountering it again.

We are running a RAP UI in a Jetty server. We have found that if the server is stopped, the stop code never finishes if there are UI sessions connected. If there are no UI sessions, the shutdown proceeds as normal.

I believe this is the same as the above bug since I've seen the Framework Stop thread waiting for the UI thread, but the UI thread is also waiting on itself, and there is nobody to notify them.

When it gets blocked in RWTLifeCycle we have the following note:

          // In any case: wait for the thread to be terminated by session timeout
          uiThread.switchThread();

I'm not really sure which session timeout this is referring to. I've tried setting the timeout in web.xml and even the Jetty server very low (1 minute or so), but it still waits for uiThread.switchThread() seemingly forever.

The above bug report also mentions about UIThread.getLock(), and we see this note in the code:

  @Override
  public Object getLock() {
    // TODO [rh] use a distinct (final) lock object instead of 'this'
    return this;
  }

Would fixing this lock issue also fix this bug?

I haven't been able to find any workarounds, and I'm not very familiar with all of this. I was attempting to reproduce it with the RAP example applications but have been unable to since I always get 404 in the browser.

We are using RAP 3.29 for the record, since we are unable to upgrade to 4.0 since we are using an older version of Jetty. But I don't necessarily see a reason that it should be fixed there.

If there are any workarounds or things I can check to verify that I am doing everything correctly please let me know. Our current workaround on the server-side is to create ANOTHER thread which forcefully interrupts the Jetty shutdown code if it takes too long, but this isn't really desirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant