Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce use of AMsoil config at runtime #454

Merged
merged 8 commits into from
Nov 12, 2015

Conversation

tcmitchell
Copy link
Member

AMsoil's config module accesses SQLite at runtime. SLQAlchemy serializes calls to SQLite so multiple clearinghouse calls interfere with each other when they need data from the config module. Some calls are intensive in their calls to the config module, like the lookup_projects call when looking up all projects.

Cache the data from the config module at startup time and use this cache at runtime. We do not expect that information to change during the run. Changes already require a restart so it's ok to cache the values at startup.

SQLite access is serialized. Remove the SQLite call from an inner loop
by caching the value of chrm.authority.
This is not the prettiest change. Instead of getting the authority
from SQLite, get it from the SA. The SA already has it cached.
Cache the SQLite values and pass them along to the SubjectInvocation
via the ABACGuard object. ABACGuard caches these values.
Cache the maintenance mode flag on the Handler base class. Add a
method on the base class to deterimine if a maintenance outage is
active. Use that in the method context instead of going through SQLite
on every method invocation.
Skip SQLite and get the authority name via the SA handler.
Avoid SQLite by passing the authority into ensure_valid_urns.
In DatabaseEngine include the line required to log all SQLAlchemy
activity. Leave it commented out so in the future it can be enabled on
demand.
@tcmitchell tcmitchell self-assigned this Nov 12, 2015
@tcmitchell tcmitchell added this to the 2.8 milestone Nov 12, 2015
tcmitchell added a commit that referenced this pull request Nov 12, 2015
Reduce use of AMsoil config at runtime
@tcmitchell tcmitchell merged commit 74abd20 into GENI-NSF:develop Nov 12, 2015
@tcmitchell tcmitchell deleted the sqlite branch November 12, 2015 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant