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

Fixed issues with distributed cache (see LDEV-3279) #1

Merged
merged 6 commits into from Nov 14, 2022

Conversation

dswitzer
Copy link
Contributor

@dswitzer dswitzer commented May 19, 2022

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

  • Added EHCacheClassLoader to resolve issues with loading RMI classes
  • The settings are now always honored (previously the properties were only populated when set to "manual" distribution mode, but it's need for "automatic" mode in order to control the ports being used)
  • Changed default ehCache distribution configuration for optimal performance by disable "via Copy" and "put" operations
  • Refactored code so serialization only happens when replicating objects using the "via copy" options (other distributed cache options just mark the objects for removal, so serialization is not required)
  • Fixed bug in TypeUtil.toJVM() which caused components to not be fully serialized (it was being treated as a struct and missing properties/methods extended from other components)

IMPORTANT — The EHCacheClassLoader uses reflection to access the isFrameworkBundle method on lucee.runtime.osgi.OSGiUtil. If that method was made public, we could avoid using reflection. @michaeloffner stated "we need to mark this in the Lucee core, that this is used in that extension and it should not be changed".

@dswitzer
Copy link
Contributor Author

I just patched another bug in which the RMI URLs were being cast to lowercase, which prevented manual distributed RMI replication from working if the cache name had uppercase characters in the name.

* RMI URLs where incorrectly being cast to lowercase, which means manual distribution only worked if the cache name was also in lowercase

Fixed issues with distributed cache (see LDEV-3279)

* Added EHCacheClassLoader to resolve issues with loading RMI classes
* The <cacheManagerEventListenerFactory /> settings are now always honored (previously the properties were only populated when set to "manual" distribution mode, but it's need for "automatic" mode in order to control the ports being used)
* Changed default ehCache distribution configuration for optimal performance by disable "via Copy" and "put" operations
* Refactored code so serialization only happens when replicating objects using the "via copy" options (other distributed cache options just mark the objects for removal, so serialization is not required)
* Fixed bug in TypeUtil.toJVM() which caused components to not be fully serialized (it was being treated as a struct and missing properties/methods extended from other components)
@dswitzer
Copy link
Contributor Author

dswitzer commented Jun 9, 2022

@michaeloffner Anything you need from me on this?

* Migrated getLogger() results to be cached
* Allowed getLogger() to specify the config object to use
* Added exception to error logging
@dswitzer
Copy link
Contributor Author

@michaeloffner

Anything else you need from me regarding this patch?

1 similar comment
@dswitzer
Copy link
Contributor Author

@michaeloffner

Anything else you need from me regarding this patch?

@dswitzer
Copy link
Contributor Author

@michaeloffner

I wanted to follow up on this again, so it doesn't get lost in the shuffle of managing this large project (and my daily workload).

* Fixed issue in EHCacheClassLoader.loadClass() workflow where it was logging classes not found as exceptions, which could generate false error logs in libraries like Logback & Log4j, which use dynamic class loaders.
* Fixed bug in searchFelixBundleClasses() where it was logging classes being found when they were not actually found.
source/java/.project Outdated Show resolved Hide resolved
Method m = clazz.getMethod("getEngine", new Class[] { Config.class });
return (CFMLEngine) m.invoke(null, this.config);
} catch (Exception e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not simply write this to the console, throw it or log it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, left over debug code that I didn't remove. I've replaced it with a comment that it's safe to ignore the exception.

* Fixed searchFelixBundleClasses() to synchronize by class
* Removed unnecessary getCFMLEngine() method
@dswitzer
Copy link
Contributor Author

dswitzer commented Nov 1, 2022

@michaeloffner,

I believe all the required changes have been made.

Let me know if you need anything more from me.

@michaeloffner michaeloffner merged commit 6763114 into lucee:master Nov 14, 2022
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.

None yet

3 participants