Fix memory leak by checking triggers uniqueness properly#1640
Merged
zroubalik merged 11 commits intokedacore:mainfrom Mar 1, 2021
Merged
Fix memory leak by checking triggers uniqueness properly#1640zroubalik merged 11 commits intokedacore:mainfrom
zroubalik merged 11 commits intokedacore:mainfrom
Conversation
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
zroubalik
previously approved these changes
Mar 1, 2021
Might be better to move the uniqueness check
similiar check moved to hpa getScaledObjectMetricSpecs Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
zroubalik
reviewed
Mar 1, 2021
Member
zroubalik
left a comment
There was a problem hiding this comment.
Looking good, just minor typo in err message
| if metricSpec.External != nil { | ||
| externalMetricName := metricSpec.External.Metric.Name | ||
| if util.Contains(externalMetricNames, externalMetricName) { | ||
| return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metircName manually", externalMetricName, scaledObject.Name) |
Member
There was a problem hiding this comment.
Suggested change
| return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metircName manually", externalMetricName, scaledObject.Name) | |
| return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metricName manually", externalMetricName, scaledObject.Name) |
zroubalik
reviewed
Mar 1, 2021
| "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" | ||
|
|
||
| kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" | ||
| "github.com/kedacore/keda/v2/controllers/util" |
Member
There was a problem hiding this comment.
The same is imported on the line below
Contributor
Author
There was a problem hiding this comment.
This is awkward. Fixed! :D
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Contributor
Author
|
I'm running pre-commit now locally. It looks like a formating change needs to be done |
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
zroubalik
reviewed
Mar 1, 2021
| - Fix a memory leak in kafka client and close push scalers ([#1565](https://github.com/kedacore/keda/issues/1565)) | ||
| - Add 'Metadata' header to AAD podIdentity request ([#1566](https://github.com/kedacore/keda/issues/1566)) | ||
| - KEDA should make sure generate correct labels for HPA ([#1630](https://github.com/kedacore/keda/issues/1630)) | ||
| - Close scalers after name check; fix memory leak ([#1636](https://github.com/kedacore/keda/issues/1636)) |
Member
There was a problem hiding this comment.
Suggested change
| - Close scalers after name check; fix memory leak ([#1636](https://github.com/kedacore/keda/issues/1636)) | |
| - Fix memory leak by checking triggers uniqueness properly ([#1640](https://github.com/kedacore/keda/pull/1640)) |
Contributor
Author
There was a problem hiding this comment.
Changed! Good suggestion
Signed-off-by: ycabrer <43866176+ycabrer@users.noreply.github.com>
Contributor
Author
|
@zroubalik How do I retrigger a check? It looks like the FOSSA check timed out. |
Member
@ycabrer I did that :) |
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.
Provide a description of what has been changed
Checklist
Fixes #
Potential fix for #1636
Scalers were not being closed properly after use.