misc: Revert GlobalConfig to use gflags again#12503
misc: Revert GlobalConfig to use gflags again#12503kgpai wants to merge 1 commit intofacebookincubator:mainfrom
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Summary: X-link: facebookincubator/nimble#147 Reverts the use of GlobalConfig and switches back to using gflags. Unfortunately using globalConfig requires us to call translateFlagsToGlobalConfig immediately after ParseCommandLineFlags to initialize it right. Because other libraries also use velox , transitively there are many such places. Thus reverting this change till we figure out a better mechanism to remove gflags dependencies. Differential Revision: D70463150
|
This pull request was exported from Phabricator. Differential Revision: D70463150 |
|
This pull request was exported from Phabricator. Differential Revision: D70463150 |
|
cc: @majetideepak |
|
Our internal linter doesnt have any issues with this change . Will investigate that separately. |
Summary: X-link: facebookincubator/velox#12503 Reverts the use of GlobalConfig and switches back to using gflags. Unfortunately using globalConfig requires us to call translateFlagsToGlobalConfig immediately after ParseCommandLineFlags to initialize it right. Because other libraries also use velox , transitively there are many such places. Thus reverting this change till we figure out a better mechanism to remove gflags dependencies. Reviewed By: amitkdutta Differential Revision: D70463150
Summary: X-link: facebookincubator/velox#12503 Pull Request resolved: #147 Reverts the use of GlobalConfig and switches back to using gflags. Unfortunately using globalConfig requires us to call translateFlagsToGlobalConfig immediately after ParseCommandLineFlags to initialize it right. Because other libraries also use velox , transitively there are many such places. Thus reverting this change till we figure out a better mechanism to remove gflags dependencies. Reviewed By: amitkdutta Differential Revision: D70463150 fbshipit-source-id: 7bbd33818666c1f4235ef2e33496fa5cd8cf6a6e
|
This pull request has been merged in bbaf9b8. |
|
@kgpai I was not expecting this to be reverted on short notice during the weekend. |
|
@majetideepak Deepak, the problems we discovered required quick mitigation. Hence, Krishna proceeded with the revert without much delay. We need to take a step back and think about why we cannot use GFlags in Velox. GFlags is a widely used library. Are you saying no other library out there uses it? Is it really not usable within a library? |
|
@mbasmanova Yes, GFlags are not recommended to be used in libraries since the flags have to be declared in the global namespace and can lead to symbol conflicts. We see this issue with folly when building the Velox shared library #10732 (comment) and also when working with the dynamic library registration #11439. They also carry the same static initialization order problem if they are being used to initialize other global static variables. You will see them mostly being used in an application. |
|
I see that both DuckDB and Arrow do not use GFlags in the core library and use config instead. |
|
Additionally my understanding is that using gflags forces anyone that wants to use Velox (or parts of velox that require the flags at least?) to build against gflags when building their application and add So I agree with @majetideepak that we should remove the usage of gflags in libvelox (no problem using it in tests etc. ofc). |
|
@majetideepak Firstly apologies for reverting the change - all blame for this should lie on my doorstep. The reason I had to work on removing it was because Velox is used directly or transitively in many thousands of packages internally and consequently again in many services at meta. Currently unfortunately without the translateFlags option it is not possible to change the behavior and considering the number of services that use Velox , this was a ticking time bomb and as oncall I felt it prudent to revert . Please consider this as a temporary setback - I will work with you in ensuring that the next solution doesnt have these problems and works for all of us. |
|
@assignUser Currently though there are many thousands of places that ParseCommandLineFlags is used internally and there is a large percentage of these that use Velox. Gflags is pretty endemic and updating all the places where its used and might be a pathway for Velox use puts a large load on the Velox team. |
Summary:
X-link: facebookincubator/nimble#147
Reverts the use of GlobalConfig and switches back to using gflags. Unfortunately using globalConfig requires us to call translateFlagsToGlobalConfig immediately after ParseCommandLineFlags to initialize it right. Because other libraries also use velox , transitively there are many such places. Thus reverting this change till we figure out a better mechanism to remove gflags dependencies.
Differential Revision: D70463150