-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MetadataProvider initialization in Hot Reload and remove duplicat…
…e Query Executor reloading (#2428) ## Why make this change? Closes #2426 Closes #2427 ## What is this change? Properly create and initialize a new set of `SqlMetadataProviders` as part of the hot-reload process of the `SqlMetadataProviderFactory`, by utilizing the `initiaizeAsync()` function. This guarantees a correctly configured set of meta data providers for the factory. Remove the event handling to hot-reload the `QueryExecutors` classes specifically, since this is already handled during the hot-reload process of the `QueryManagerFactory`. That process creates new and up to date `QueryExecutors` as part of a hot-reload. With the correct initialization of the meta data providers, we can remove the code that saves the `DefaultDataSourceName` to be passed along the hot-reloaded configs. With all of the data structures we initialized on new meta data providers, we do not need to save the data source name and hot-reloading will be more resilient. This is because we will build all of the data structures which depend on this DefaultDataSourceName fresh from newly created or cleared objects, and we do not have to worry about maintaining previous configuration's DefaultDataSourceName, everything will simply use the new name generated during a hot-reload. ## How was this tested? ### Testing Scenario Scenario A: Handling a change in entities in the config Objective: Verify that hot-reload correctly refreshes the MetadataProviders and QueryExecutors when we hot-reload the entities by making a REST request. Steps: Start with MSSQL with a valid config file that contains some valid entities. Make a REST request that targets one of the entities and observe the results to compare against later. Change the entities section by removing an entity and any entities that have a relationship with that entity. Make a REST request for that entity and observe that the entity is not found. Add the removed entities back to the config file. Make a REST request for that same entity and observe the results match the original REST request. ## Sample Request(s) For the "Book" entity with a rest path of "rest" https://localhost:5001/rest/Book
- Loading branch information
1 parent
dec9d0e
commit c9aa87b
Showing
11 changed files
with
27 additions
and
119 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.