[FAB] configuring updating of permissions #4172
Merged
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.
This PR leverages @mistercrunch's FAB change (which was released in
1.9.5
) to optionally disable updating of Flask-AppBuilder (FAB) permissions which can create a lot of contention and race conditions in the perm-related tables when running multiple Gunicorn instances.I toiled for a bit about how best to implement optionally enabling/disabling this feature (which really only needs to be enabled whilst running
superset init
). Sadly given that the Flask-AppBuilder is configured in a global context__init__.py
which is defined before anything else It seems like there's two options to configure Flask-AppBuilder dynamically from within the CLI.:config.py
I opted for the later as this feature really is a switch which needs to change state during the initialization process (as described in
installation.rst
) and the the former would require a second configuration file simply to enable/disable the feature.to: @mistercrunch
cc: @michellethomas