Skip to content

Commit e71bb5b

Browse files
generatedunixname89002005232357facebook-github-bot
generatedunixname89002005232357
authored andcommitted
Revert D71057292
Summary: This diff reverts D71057292 T217967951, seems to be causing a lot of timeouts when run with ASAN mode. Reviewed By: alexmalyshev Differential Revision: D71199135 fbshipit-source-id: 4fc76c8a7fda17cd907e7e2549411e1973eab41f
1 parent efb2144 commit e71bb5b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Lib/init_cinderx.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ONLY USED FOR CINDERX DEVELOPMENT
2+
# This file is deliberately not included in the set of deep-frozen bootstrap
3+
# libraries so it can easily be excluded from the distribution to avoid
4+
# attempting to initialize CinderX. This is desirable because this code imports
5+
# importlib.util and some tests are surprised when they find this unexpectedly
6+
# loaded as part of bootstrap.
7+
8+
import importlib.util
9+
10+
# `cinderx` is the Python module in fbcode/cinderx/PythonLib which wraps the
11+
# `_cinderx` C++ extension in fbcode/cinderx/_cinderx.cpp. Both need to be
12+
# available to load CinderX.
13+
if not (
14+
importlib.util.find_spec("cinderx") is None
15+
or importlib.util.find_spec("_cinderx") is None
16+
):
17+
try:
18+
import cinderx
19+
20+
cinderx.init()
21+
except Exception as e:
22+
raise RuntimeError("Failed to initialize CinderX module") from e

0 commit comments

Comments
 (0)