Skip to content

Commit

Permalink
Fix static initialization order fiasco in velox (#24458)
Browse files Browse the repository at this point in the history
Summary:

X-link: facebookincubator/velox#12204

Replace global statics with local to avoid non-determinism
https://en.cppreference.com/w/cpp/language/siof

Differential Revision: D68857074
  • Loading branch information
mkatsevVR authored and facebook-github-bot committed Jan 31, 2025
1 parent 719bfe2 commit 8d66353
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
#include "presto_cpp/main/common/Exception.h"
#include "presto_cpp/main/common/Utils.h"
#include "velox/common/base/Exceptions.h"
#include "velox/common/config/GlobalConfig.h"
#include "velox/flag_definitions/flags.h"

using namespace facebook::velox;
using namespace facebook::presto;

TEST(VeloxToPrestoExceptionTranslatorTest, exceptionTranslation) {
config::globalConfig.exceptionUserStacktraceEnabled = true;
FLAGS_velox_exception_user_stacktrace_enabled = true;
translateFlagsToGlobalConfig();
for (const bool withContext : {false, true}) {
for (const bool withAdditionalContext : {false, true}) {
SCOPED_TRACE(fmt::format("withContext: {}", withContext));
Expand Down

0 comments on commit 8d66353

Please sign in to comment.