@@ -174,11 +174,12 @@ func (d *Director) HandleRequest(ctx context.Context, reqCtx *handlers.RequestCo
174174
175175 // Prepare per request data by running PrepareData plugins.
176176 if d .runPrepareDataPlugins (ctx , reqCtx .SchedulingRequest , snapshotOfCandidatePods ) != nil {
177- return reqCtx , errutil.Error {Code : errutil .Internal , Msg : "failed to prepare request data" }
177+ // Don't fail the request if PrepareData plugins fail.
178+ logger .V (logutil .DEFAULT ).Error (err , "failed to prepare per request data" )
178179 }
179180
180181 // Run admit request plugins
181- if ! d .withAdmissionPlugins (ctx , reqCtx .SchedulingRequest , snapshotOfCandidatePods ) {
182+ if ! d .runAdmissionPlugins (ctx , reqCtx .SchedulingRequest , snapshotOfCandidatePods ) {
182183 logger .V (logutil .DEFAULT ).Info ("Request cannot be admitted" )
183184 return reqCtx , errutil.Error {Code : errutil .Internal , Msg : "request cannot be admitted" }
184185 }
@@ -352,18 +353,6 @@ func (d *Director) runPreRequestPlugins(ctx context.Context, request *scheduling
352353 }
353354}
354355
355- // executePlugins executes PrepareDataPlugins sequentially.
356- // TODO: Change to DAG execution in the following PRs.
357- func (d * Director ) executePlugins (ctx context.Context , request * schedulingtypes.LLMRequest , pods []schedulingtypes.Pod , plugins []PrepareDataPlugin ) error {
358- for _ , plugin := range plugins {
359- err := prepareDataWithRetriesAndTimeout (plugin , ctx , request , pods )
360- if err != nil {
361- return err
362- }
363- }
364- return nil
365- }
366-
367356// prepareDataWithRetriesAndTimeout executes the PrepareRequestData plugins with retries and timeout.
368357func prepareDataWithRetriesAndTimeout (plugin PrepareDataPlugin , ctx context.Context , request * schedulingtypes.LLMRequest , pods []schedulingtypes.Pod ) error {
369358 currentTimeout := prepareDataTimeout
@@ -392,18 +381,21 @@ func prepareDataWithRetriesAndTimeout(plugin PrepareDataPlugin, ctx context.Cont
392381 return nil
393382}
394383
384+ // TODO: Execute plugins in parallel once DAG execution is supported.
385+ // runPrepareDataPlugins executes PrepareDataPlugins sequentially.
395386func (d * Director ) runPrepareDataPlugins (ctx context.Context ,
396387 request * schedulingtypes.LLMRequest , pods []schedulingtypes.Pod ) error {
397- err := d .executePlugins (ctx , request , pods , d .requestControlPlugins .prepareDataPlugins )
398- if err != nil {
399- log .FromContext (ctx ).Error (err , "failed to execute PrepareData plugins as DAG, falling back to parallel execution" )
400- return err
388+ for _ , plugin := range d .requestControlPlugins .prepareDataPlugins {
389+ err := prepareDataWithRetriesAndTimeout (plugin , ctx , request , pods )
390+ if err != nil {
391+ return err
392+ }
401393 }
402394
403395 return nil
404396}
405397
406- func (d * Director ) withAdmissionPlugins (ctx context.Context ,
398+ func (d * Director ) runAdmissionPlugins (ctx context.Context ,
407399 request * schedulingtypes.LLMRequest , pods []schedulingtypes.Pod ) bool {
408400 loggerDebug := log .FromContext (ctx ).V (logutil .DEBUG )
409401 for _ , plugin := range d .requestControlPlugins .admissionPlugins {
0 commit comments