Skip to content

Commit

Permalink
[fix](be) fix the crash when there is no tzfile in docker env (#23071)
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb authored and xiaokang committed Aug 22, 2023
1 parent 88a11cc commit f540ce7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions be/src/util/timezone_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ void TimezoneUtils::load_timezone_names() {
path += tzdir;
path += '/';

if (!std::filesystem::exists(path)) {
LOG_WARNING("Cannot find system tzfile. Abandon to preload timezone name cache.");
return;
}

auto path_prefix_len = path.size();
for (auto const& dir_entry : std::filesystem::recursive_directory_iterator {path}) {
if (dir_entry.is_regular_file()) {
Expand Down

0 comments on commit f540ce7

Please sign in to comment.