Don't exit the process when locale-collate fails to be set from env during startup#3067
Merged
enjoy-binbin merged 2 commits intoJan 29, 2026
Merged
Conversation
…uring startup Before ca6aead, even if setlocale fails, we won't do anything. ``` setlocale(LC_COLLATE,""); ``` And now we will exit the process if the setlocale fails, this resulted in process startup failures on some machines. (some kind of breaking change?) ``` if (setlocale(LC_COLLATE,server.locale_collate) == NULL) { serverLog(LL_WARNING, "Failed to configure LOCALE for invalid locale name."); exit(1); } ``` In this commit, if we fail to set the locale_collate through environment variables, we maintain backward compatibility and do not exit. Signed-off-by: Binbin <binloveplay1314@qq.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3067 +/- ##
============================================
+ Coverage 74.16% 74.34% +0.18%
============================================
Files 129 129
Lines 70988 71012 +24
============================================
+ Hits 52649 52796 +147
+ Misses 18339 18216 -123
🚀 New features to boost your workflow:
|
zuiderkwast
approved these changes
Jan 16, 2026
zuiderkwast
left a comment
Contributor
There was a problem hiding this comment.
OK, but I don't think we need to mention in in valkey.conf.
Signed-off-by: Binbin <binloveplay1314@qq.com>
zuiderkwast
approved these changes
Jan 19, 2026
Member
Author
|
I am merging it, please feel free to leave a comment if i missed something. |
harrylin98
pushed a commit
to harrylin98/valkey_forked
that referenced
this pull request
Feb 19, 2026
…uring startup (valkey-io#3067) Before ca6aead, even if setlocale fails, we won't do anything. ``` setlocale(LC_COLLATE,""); ``` And now we will exit the process if the setlocale fails, this resulted in process startup failures on some machines. (some kind of breaking change?) ``` if (setlocale(LC_COLLATE,server.locale_collate) == NULL) { serverLog(LL_WARNING, "Failed to configure LOCALE for invalid locale name."); exit(1); } ``` In this commit, if we fail to set the locale_collate through environment variables, we maintain backward compatibility and do not exit. In a case where we did exit before, we don't exit now, seems safe. It's not a breaking change and the behavior in this case was undocumented. Signed-off-by: Binbin <binloveplay1314@qq.com>
hpatro
pushed a commit
to hpatro/valkey
that referenced
this pull request
Mar 5, 2026
…uring startup (valkey-io#3067) Before ca6aead, even if setlocale fails, we won't do anything. ``` setlocale(LC_COLLATE,""); ``` And now we will exit the process if the setlocale fails, this resulted in process startup failures on some machines. (some kind of breaking change?) ``` if (setlocale(LC_COLLATE,server.locale_collate) == NULL) { serverLog(LL_WARNING, "Failed to configure LOCALE for invalid locale name."); exit(1); } ``` In this commit, if we fail to set the locale_collate through environment variables, we maintain backward compatibility and do not exit. In a case where we did exit before, we don't exit now, seems safe. It's not a breaking change and the behavior in this case was undocumented. Signed-off-by: Binbin <binloveplay1314@qq.com> Signed-off-by: Harkrishn Patro <bunty.hari@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before ca6aead, even if setlocale fails, we
won't do anything.
And now we will exit the process if the setlocale fails, this resulted in process
startup failures on some machines. (some kind of breaking change?)
In this commit, if we fail to set the locale_collate through environment variables,
we maintain backward compatibility and do not exit.
In a case where we did exit before, we don't exit now, seems safe. It's not a breaking
change and the behavior in this case was undocumented.