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

#5717 - Nima WebServer.stop() is slow / not timely when there are no active requests #5748

Conversation

rbygrave
Copy link
Contributor

@rbygrave rbygrave commented Dec 21, 2022

This branch current has 2 tests and 2 approaches to solving this issue.

The latest commit solves the issue using a modified/hacked version of ThreadPerTaskExecutor and a new interface InterruptibleTask (and this approaches points to trying to get a similar change to the JDK).

The prior solution used application code to maintain the active Http1Connection which duplicates functionality of ThreadPerTaskExecutor and as such doesn't appeal as an elegant solution.

… not timely when there are no active requests
…leTask()

shutdown() is modified to call the new tryStopInterruptableTask() method which
identifies task that are InterruptableTask.canInterrupt() true and interrupts
those threads
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 21, 2022
spericas added a commit to spericas/helidon that referenced this pull request Jan 19, 2023
…or more information see issue helidon-io#5717. This approach is based on that described in PR helidon-io#5748. It includes a simple executor SPI for tasks that are immediately interruptable, such as those waiting to read connection preambles. Some new tests that verify faster webserver shutdown.
spericas added a commit that referenced this pull request Jan 27, 2023
…5876)

* Proposal to implement a more efficient webserver shutdown strategy. For more information see issue #5717. This approach is based on that described in PR #5748. It includes a simple executor SPI for tasks that are immediately interruptable, such as those waiting to read connection preambles. Some new tests that verify faster webserver shutdown.

* Updated copyright year.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Removed print statements and fixed logging.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Fixed checkstyle.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Avoid using @servertest when stopping server manually.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Dropped SPI for tasks, moved interfaces into webserver package.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Fixed checkstyle.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Make interface package private.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

---------

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
@tomas-langer
Copy link
Member

This should be fixed by #5876, I think this PR no longer makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants