Register ITargetScalerErrorRepository in AddCommonScaleServices and make public#3204
Open
alrod wants to merge 1 commit into
Open
Register ITargetScalerErrorRepository in AddCommonScaleServices and make public#3204alrod wants to merge 1 commit into
alrod wants to merge 1 commit into
Conversation
ae3dc4c to
163e603
Compare
…ake public ScaleManager now requires ITargetScalerErrorRepository (added in 3.0.46), but the registration was only added in AddWebJobs(). Callers using ConfigureWebJobsScale (e.g. Scale Controller) go through AddWebJobsScale -> AddCommonScaleServices, which was missing this registration, causing: Unable to resolve service for type 'ITargetScalerErrorRepository' while attempting to activate 'ScaleManager' Changes: - Add TryAddSingleton<ITargetScalerErrorRepository, NullTargetScalerErrorRepository> to AddCommonScaleServices so all scale host scenarios work. - Make ITargetScalerErrorRepository and NullTargetScalerErrorRepository public so external consumers (Scale Controller) can implement the interface directly without reflection-based DispatchProxy workarounds. Co-authored-by: Dobby <dobby@microsoft.com>
163e603 to
90bf7aa
Compare
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.
Summary
Fix missing DI registration in AddCommonScaleServices and make ITargetScalerErrorRepository public so external consumers can implement it directly.
Problem
SDK 3.0.46 (PR #3191) introduced ITargetScalerErrorRepository as a required dependency of ScaleManager. However, the TryAddSingleton registration was only added in AddWebJobs(). Callers using ConfigureWebJobsScale (e.g. Scale Controller) go through AddWebJobsScale -> AddCommonScaleServices, which was missing this registration, causing:
Making the interface public allows Scale Controller to provide its own in-memory implementation that tracks errored target scalers within the process lifetime, so broken scalers fall back to incremental monitoring without retrying every cycle.
Changes
Testing