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

Asynchronously refresh registry in transformation service #2060

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

pyalex
Copy link
Collaborator

@pyalex pyalex commented Nov 18, 2021

Signed-off-by: pyalex moskalenko.alexey@gmail.com

What this PR does / why we need it:

Currently cached registry could expire by preconfigured TTL and will be lazy reloaded on next request, which might affect performance of transformation service.
This PR proposes to run background thread that will periodically refresh registry instead.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2021

Codecov Report

Merging #2060 (e524fa0) into master (7032559) will increase coverage by 25.59%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #2060       +/-   ##
===========================================
+ Coverage   57.54%   83.14%   +25.59%     
===========================================
  Files         100      100               
  Lines        8028     8099       +71     
===========================================
+ Hits         4620     6734     +2114     
+ Misses       3408     1365     -2043     
Flag Coverage Δ
integrationtests 73.74% <66.66%> (?)
unittests 58.23% <0.00%> (+0.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/feature_store.py 90.24% <66.66%> (+19.12%) ⬆️
sdk/python/feast/repo_operations.py 42.58% <0.00%> (-1.37%) ⬇️
sdk/python/feast/online_response.py 87.71% <0.00%> (+1.75%) ⬆️
sdk/python/feast/infra/online_stores/sqlite.py 96.77% <0.00%> (+2.15%) ⬆️
sdk/python/feast/feature.py 72.72% <0.00%> (+3.03%) ⬆️
sdk/python/feast/infra/provider.py 91.73% <0.00%> (+4.95%) ⬆️
sdk/python/feast/errors.py 70.00% <0.00%> (+5.00%) ⬆️
sdk/python/feast/data_source.py 61.29% <0.00%> (+6.45%) ⬆️
sdk/python/feast/infra/offline_stores/file.py 96.80% <0.00%> (+8.00%) ⬆️
sdk/python/feast/feature_view.py 88.05% <0.00%> (+10.69%) ⬆️
... and 51 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7032559...e524fa0. Read the comment docs.

Comment on lines +144 to +147
registry = Registry(registry_config, repo_path=self.repo_path)
registry.refresh()

self._registry = registry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for this refactoring?

Copy link
Collaborator Author

@pyalex pyalex Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there're multiple threads accessing self._registry it makes sense to fully construct replacement (actual proto is being loaded in registry.refresh, so before that new Registry is still half baked) before making it available for everybody else

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, pyalex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@achals
Copy link
Member

achals commented Nov 18, 2021

/lgtm

@feast-ci-bot feast-ci-bot merged commit 640fd68 into feast-dev:master Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants