-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In order to use the ConfigOptions structure in more places, it was changed to be an Arc<RwLock<ConfigOptions>> by @waitingkuo in #3455 which is good
The usecase there was so that the configuration was owned by SessionContext but other parts could read it if necessary -- specifically, information_schema.df_settings / SHOW ALL initially.
I have been trying to consolidate these settings (see #3822) but find that working with ConfigOptions is somewhat of a pain (as you have to type Arc<RwLock> a bunch and then to update values you have to call read() and write()
Describe the solution you'd like
I would like to move the mutability handling into ConfigOption so this looks like
#[impl(Clone)]
struct ConfigOptions {
data: Arc<RwLock<...>>
}And change all places in the code that use
Arc<RwLock<ConfigOptions>>to
ConfigOptions
That would hide the details of shared ownership more nicely I think
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Came up here with @thinkharderdev : #3822 (comment)