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

Maximum cache size (in bytes) incorrectly reported #105

Closed
guusdk opened this issue Nov 4, 2024 · 0 comments
Closed

Maximum cache size (in bytes) incorrectly reported #105

guusdk opened this issue Nov 4, 2024 · 0 comments

Comments

@guusdk
Copy link
Member

guusdk commented Nov 4, 2024

A clustered cache's reported 'max cache size' is wrong, when it is based on Openfire-provided (default) values.

The unit of those values is expected to be expressed in units of 'bytes'. Hazelcast uses 'megabytes'. Furthermore, Hazelcast doesn't accept negative values.

When a cache is created based on Openfire-provided (default) values, the value is processed accordingly:

  • Openfire's representation of 'unlimited' (-1) is replaced by Integer.MAX_VALUE
  • Any non-negative value is divided by 1024*1024 (with some rounding happening).

Thus, the configuration is roughly correct.

However, when the cache size is read again (which mostly is used for diagnostic purposes, as far as I can see), this modification isn't reverted. That causes Openfire to 'see' values that are wrong (eg, values off by a factor of a million, or a large integer value when unlimited is intended).

guusdk added a commit to guusdk/openfire-hazelcast-plugin that referenced this issue Nov 4, 2024
The maximum cache size was reported by the ClusteredCache implementation incorrectly, when based on Openfire-provided configuration.

This change effectively reverts the value modifications performed by `org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory#createCache`
guusdk added a commit to guusdk/openfire-hazelcast-plugin that referenced this issue Nov 5, 2024
The maximum cache size was reported by the ClusteredCache implementation incorrectly, when based on Openfire-provided configuration.

This change effectively reverts the value modifications performed by `org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory#createCache`
@guusdk guusdk closed this as completed in e87bfe2 Nov 5, 2024
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