Francesco Mari commented on OAK-6770:

While investigating this issue, I figured out that the following sources are 
looked up for configuration values in this order.

# The component configuration.
# The framework configuration.
# System properties, only for cache sizes.

The first source containing the configuration value wins. This doesn't seem to 
make much sense. I would have expected the system properties to have precedence 
over the component configuration, in order to give users a way to override 
cache sizes on the command line for experimental usage.

Moreover, I quite don't understand the reason why configuration values are 
looked up in the framework configuration, which is a flat namespace for 
everything deployed in the OSGi framework. In addition to that, looking into 
the framework properties also triggers a lookup in the system properties. 
According to the Javadoc for {{org.osgi.framework.BundleContext#getProperty}},

If the key is not found in the Framework properties, the system properties are 
then searched. The method returns null if the property is not found.

This behaviour modifies the lookup of configuration values to the following.

# The component configuration.
# The framework configuration.
# System properties, for every configuration.
# System properties, only for cache sizes.

This strategy basically makes every configuration property feature-flaggable as 
long as they are not specified in an OSGi configuration which, in my opinion, 
is quite arbitrary and dangerous. As such, I propose to stop looking up the 
framework configuration, and to lookup system properties for cache sizes before 
we look into the component configuration (which seems to be a saner approach to 

[~mduerig], [~dulceanu], [~volteanu], what do you think?

> Convert oak-segment-tar to OSGi R6 annotations
> ----------------------------------------------
>                 Key: OAK-6770
>                 URL: https://issues.apache.org/jira/browse/OAK-6770
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: segment-tar
>            Reporter: Robert Munteanu
>            Assignee: Francesco Mari
>            Priority: Minor
>              Labels: osgi
>             Fix For: 1.10

This message was sent by Atlassian JIRA

Reply via email to