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

LDEV-4696 - Feat/allow Lucee threads to cooperatively stop avoiding threadDeath in tomcat #2425

Open
wants to merge 5 commits into
base: 6.2
Choose a base branch
from

Conversation

xdecock
Copy link
Contributor

@xdecock xdecock commented Oct 30, 2024

Hello,

This is a rewrite of a previously closed Pull request,

The goal of this mr is to (at the cost of a slight overhead) allow the inLucee() code to cooperate, to help out with readability, i've used a bytecode "generator", which should reduce the clutter quite a bit

This approach won't for obvious reasons solve all the code path possibles (an infinite recursion is out of scope) but it should allow a better way to stop threads dynamically.

This code has been used in production with millions of request per day for years now, and we started see thread death again by trying to go back to vanilla lucee and getting traffic spikes.

If there is anything that can be done to help getting this in a better state, please let me know.

In leads for improvement:

  • Use processingDirective to generate non preemptive bytecode to allow better performances (not sure lot of people needs it, but looks doable here).
  • If some other code path require to be made preemptive, i'd gladly be pointed there, i've updated the most obvious paths.
  • If code style need reworks, tell me.

https://luceeserver.atlassian.net/browse/LDEV-4696

@xdecock xdecock force-pushed the feat/allow-inLucee-threadStop branch from d6b950f to a381e08 Compare October 30, 2024 12:56
@xdecock xdecock changed the title LDEV-4696 - Feat/allow in lucee thread stop LDEV-4696 - Feat/allow Lucee threads to cooperatively stop avoiding threadDeath in tomcat Oct 30, 2024
@xdecock xdecock force-pushed the feat/allow-inLucee-threadStop branch 5 times, most recently from 703f501 to e7a4eac Compare October 30, 2024 13:19
@xdecock xdecock force-pushed the feat/allow-inLucee-threadStop branch from e7a4eac to 1920622 Compare October 30, 2024 13:23
Fix copy paste, it's a while loop not a for loop
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

Successfully merging this pull request may close these issues.

1 participant