Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Put existing work for an experimental backpressure feature under a feature flag #1055

Merged
merged 4 commits into from
Jul 14, 2020

Conversation

Jont828
Copy link
Contributor

@Jont828 Jont828 commented Jul 9, 2020

Put the experimental work for backpressure so far behind a feature flag so the experimental changes can be merged safely to main

@Jont828 Jont828 added the wip Work-in-Progress label Jul 9, 2020
@Jont828 Jont828 changed the base branch from main to experimental July 9, 2020 22:01
@Jont828 Jont828 marked this pull request as ready for review July 10, 2020 21:35
@shashankram
Copy link
Member

I propose we use the featureflag package for backpressure since it is going to be static and doesn't need to change once the osm-controller pod is running. The backpressure flag will need to be extended to other packages (catalog, cds) and passing one flag around is not a great idea. Right now its okay because the only backpressure code lives in pkg/smi.
Could you patch this PR to integrate the backpressure flag with the featureflag package.

@Jont828 Jont828 force-pushed the backpressure-flag branch from fb2aa5e to 2f5291f Compare July 13, 2020 18:31
Copy link
Member

@shashankram shashankram left a comment

Choose a reason for hiding this comment

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

Almost there!
Commit needs to be rebased and a few minor comments.

cmd/ads/ads.go Outdated Show resolved Hide resolved
pkg/featureflags/featureflags.go Outdated Show resolved Hide resolved
pkg/featureflags/featureflags.go Show resolved Hide resolved
pkg/smi/client.go Outdated Show resolved Hide resolved
pkg/smi/client.go Outdated Show resolved Hide resolved
pkg/smi/client.go Show resolved Hide resolved
Wraps the experimental backpressure code using a feature flag.
This is in preparation for the merge from experimental -> main.
@Jont828 Jont828 requested a review from a team as a code owner July 13, 2020 20:37
@Jont828 Jont828 requested review from draychev and michelleN July 13, 2020 22:56
pkg/smi/client.go Outdated Show resolved Hide resolved
Comment on lines 213 to 216
if c.backpressureEnabled {
log.Info().Msgf("Backpressure turned off!")
return backpressureList
}
Copy link
Member

Choose a reason for hiding this comment

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

Not required.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shashankram I think this is a good guard against c.caches.Backpressure being nil.

@Jont828 this should be reversed though - return the empty list of backpressures when the feature is not enabled (like we said - to avoid looking into uninitialized caches)

Copy link
Contributor

Choose a reason for hiding this comment

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

And we could also swap c.backpressureEnabled with featureflags.IsBackpressureEnabled()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually should we log an error instead if ListBackpressures is called while backpressure is disabled?

Copy link
Contributor

@draychev draychev left a comment

Choose a reason for hiding this comment

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

A few tweaks and we can merge this :)

Comment on lines 213 to 216
if c.backpressureEnabled {
log.Info().Msgf("Backpressure turned off!")
return backpressureList
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@shashankram I think this is a good guard against c.caches.Backpressure being nil.

@Jont828 this should be reversed though - return the empty list of backpressures when the feature is not enabled (like we said - to avoid looking into uninitialized caches)

Comment on lines 213 to 216
if c.backpressureEnabled {
log.Info().Msgf("Backpressure turned off!")
return backpressureList
}
Copy link
Contributor

Choose a reason for hiding this comment

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

And we could also swap c.backpressureEnabled with featureflags.IsBackpressureEnabled()

pkg/smi/types.go Outdated Show resolved Hide resolved
@Jont828 Jont828 requested review from draychev and shashankram July 14, 2020 17:48
pkg/featureflags/featureflags.go Outdated Show resolved Hide resolved
pkg/smi/client.go Show resolved Hide resolved
@Jont828 Jont828 merged commit 7d542cd into experimental Jul 14, 2020
@Jont828 Jont828 deleted the backpressure-flag branch July 14, 2020 18:40
@draychev
Copy link
Contributor

draychev commented Aug 5, 2020

ref #1376

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wip Work-in-Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants