Fix performance impact of bundle activation on policy queries#1516
Merged
patrick-east merged 2 commits intoopen-policy-agent:masterfrom Jun 24, 2019
Merged
Fix performance impact of bundle activation on policy queries#1516patrick-east merged 2 commits intoopen-policy-agent:masterfrom
patrick-east merged 2 commits intoopen-policy-agent:masterfrom
Conversation
These changes update the storage to accept arbitrary key/value parameters when creating transactions. The container is passed to trigger callbacks that are invoked when transactions commit. The use case for this is avoiding parse and compile operations on modules loaded out of bundles. The parse and compile step on large bundles can take several seconds. Since the triggers are executed while the store's read-lock is held, policies queries block. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
These changes update the manager and bundle plugin to avoid parsing and compiling modules during the manager's trigger callback. Since policy queries are blocked while triggers execute, it's adavantageous to cache the compiler that is obtained during bundle activation and reduce the work done in the trigger callback. Also, as part of these changes, the bundle plugin incorporates remaining modules when it recompiles. This ensures that remaining modules are correct. Fixes open-policy-agent#1515 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
ashutosh-narkar
approved these changes
Jun 24, 2019
patrick-east
approved these changes
Jun 24, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These changes resolve #1515 by caching the compiler created during bundle activation and passing it through to the manager's trigger callback. See the commit messages for a bit more info.