You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you let the StdSchedulerFactory load the configuration from a file specified the environment variable "quartz.config" (defined in StdSchedulerFactory.PropertiesFile), then you get a Quartz.SchedulerConfigException saying Unknown configuration property 'quartz.config'
That change introduced an explicit allowed list of configuration values, which doesn't include "quartz.config", but "quartz.config" is always added from the environment variables by OverrideWithSysProps.
To Reproduce
[Test]publicasync Task TestFactoryShouldLoadPropertiesFromFileWhosePathIsGivenByEnvVariable(){vartempFile= Path.GetTempFileName();try{conststringInstanceName="TestInstance";
File.WriteAllText(tempFile,$"{StdSchedulerFactory.PropertySchedulerInstanceName}={InstanceName}");
Environment.SetEnvironmentVariable(StdSchedulerFactory.PropertiesFile, tempFile);varfactory=new StdSchedulerFactory();
factory.Initialize();// <- optional, because `GetScheduler` does it anywayvarscheduler=await factory.GetScheduler();
Assert.AreEqual(InstanceName, scheduler.SchedulerName);}finally{try{
File.Delete(tempFile);}catch(Exception){// ignore temp file delete error}
Environment.SetEnvironmentVariable(StdSchedulerFactory.PropertiesFile,null);}}
Expected behavior
Using environment variable "quartz.config" to specify the path to the config file should not cause an exception.
Perhaps OverrideWithSysProps should explicitly skip environment variable "quartz.config" (StdSchedulerFactory.PropertiesFile)?
The text was updated successfully, but these errors were encountered:
Thanks for the detailed bug report and test case. Skipping this in override seems reasonable. Would you like to take a stab creating a fix via a PR against the 3.x branch?
Describe the bug
If you let the
StdSchedulerFactory
load the configuration from a file specified the environment variable "quartz.config" (defined inStdSchedulerFactory.PropertiesFile
), then you get aQuartz.SchedulerConfigException
sayingUnknown configuration property 'quartz.config'
Version used
Appeared in v3.8.0, was not present in v.3.7.0
Seems to have been caused by 5562a9a
That change introduced an explicit allowed list of configuration values, which doesn't include "quartz.config", but "quartz.config" is always added from the environment variables by
OverrideWithSysProps
.To Reproduce
Expected behavior
Using environment variable "quartz.config" to specify the path to the config file should not cause an exception.
Perhaps
OverrideWithSysProps
should explicitly skip environment variable "quartz.config" (StdSchedulerFactory.PropertiesFile
)?The text was updated successfully, but these errors were encountered: