Commit 48cc9a0
committed
Externalize Scheduler's saturation logic
This commit refactors the request processing pipeline, externalizing
saturation detection and criticality-based service differentiation
from the Scheduler. These responsibilities are now primarily managed by
the RequestControl.Director.
This change is a preparatory step for the introduction of a new
Flow Controller component, which will eventually absorb these admission
control duties.
Key changes include:
- Introduced `PreDispatch` method to `RequestControl.Director` It
utilizes the `SaturationDetector` for admission control of
non-critical requests and handles request criticality to determine if
saturation checks are bypassed.
- The saturation detection logic for dropping non-critical requests
is intentionally preserved within the `Director` at this stage.
This allows the option to bypass the future Flow Controller
component during its maturation, ensuring the existing saturation
and sheddable request behavior can be maintained as a fallback.
- Simplified the `Scheduler` to focus solely on preference-based
filtering and pod selection for requests that have already been
admitted by the `Director`.
- Removed the `HasCapacityFilter` and the distinct critical/sheddable
filter paths from the `Scheduler`'s internal logic. The `Scheduler`
now applies a single, unified preference filter chain (`lowLatencyFilter`)
to all incoming requests.
- Updated `main.go` to instantiate the `SaturationDetector` and
`RequestControl.Director`, wiring them into the request handling flow.
- Updated tests across `scheduler_test.go`, `director_test.go`, and
`filter_test.go` to align with the new component responsibilities,
adding additional coverage where necessary.
This refactoring leads to a cleaner architecture, making the `Scheduler`
a more focused component and centralizing initial admission control logic,
while paving the way for the future Flow Controller.
This is aligned with the direction in `0683-epp-architecture-proposal`
and should be nearly no-op in terms of EPP behavior.1 parent cb52769 commit 48cc9a0
File tree
13 files changed
+1351
-514
lines changed- cmd/epp
- pkg/epp
- requestcontrol
- saturationdetector
- scheduling
- config
- plugins/filter
- server
13 files changed
+1351
-514
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | 147 | | |
142 | | - | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
| 152 | + | |
146 | 153 | | |
147 | 154 | | |
148 | 155 | | |
| |||
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
156 | | - | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| |||
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | | - | |
168 | 174 | | |
169 | | - | |
170 | 175 | | |
| 176 | + | |
171 | 177 | | |
172 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | | - | |
| 191 | + | |
175 | 192 | | |
176 | 193 | | |
177 | 194 | | |
178 | 195 | | |
179 | 196 | | |
180 | | - | |
| 197 | + | |
181 | 198 | | |
182 | 199 | | |
183 | 200 | | |
184 | | - | |
| 201 | + | |
| 202 | + | |
185 | 203 | | |
186 | 204 | | |
187 | | - | |
| 205 | + | |
188 | 206 | | |
189 | 207 | | |
190 | 208 | | |
| 209 | + | |
| 210 | + | |
191 | 211 | | |
192 | | - | |
| 212 | + | |
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
197 | | - | |
198 | | - | |
| 217 | + | |
199 | 218 | | |
200 | 219 | | |
201 | 220 | | |
202 | 221 | | |
203 | | - | |
| 222 | + | |
204 | 223 | | |
205 | 224 | | |
206 | 225 | | |
207 | | - | |
| 226 | + | |
| 227 | + | |
208 | 228 | | |
209 | 229 | | |
210 | 230 | | |
| |||
232 | 252 | | |
233 | 253 | | |
234 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
235 | 266 | | |
236 | 267 | | |
237 | 268 | | |
| |||
321 | 352 | | |
322 | 353 | | |
323 | 354 | | |
324 | | - | |
325 | 355 | | |
0 commit comments