Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make configs dir/dbfilename/cluster-config-file reject empty string (#…
…636) Until now, these configuration items allowed typing empty strings, but empty strings behave strangely. Empty dir will fail in chdir with No such file or directory: ``` ./src/valkey-server --dir "" *** FATAL CONFIG FILE ERROR (Version 255.255.255) *** Reading the configuration file, at line 2 >>> 'dir ""' No such file or directory ``` Empty dbfilename will cause shutdown to fail since it will always fail in rdb save: ``` ./src/valkey-server --dbfilename "" * User requested shutdown... * Saving the final RDB snapshot before exiting. # Error moving temp DB file temp-19530.rdb on the final destination (in server root dir /xxx/xxx/valkey): No such file or directory # Error trying to save the DB, can't exit. # Errors trying to shut down the server. Check the logs for more information. ``` Empty cluster-config-file will fail in clusterLockConfig: ``` ./src/valkey-server --cluster-enabled yes --cluster-config-file "" Can't open in order to acquire a lock: No such file or directory ``` With this patch, now we will just reject it in config set like: ``` *** FATAL CONFIG FILE ERROR (Version 255.255.255) *** Reading the configuration file, at line 2 >>> 'xxx ""' xxx can't be empty ``` Signed-off-by: Binbin <[email protected]>
- Loading branch information