@@ -54,7 +54,7 @@ func (r *Runner) watchPredictionResponses(ctx context.Context, predictionID stri
5454 for {
5555 select {
5656 case <- ctx .Done ():
57- log .Debugw ("response watcher canceled" , "prediction_id" , predictionID )
57+ log .Tracew ("response watcher canceled" , "prediction_id" , predictionID )
5858 return
5959
6060 // TODO: Add inotify case when implemented
@@ -68,7 +68,7 @@ func (r *Runner) watchPredictionResponses(ctx context.Context, predictionID stri
6868 // Drain IPC OUTPUT notifications - when inotify available, we blackhole these
6969 // When inotify unavailable, this triggers immediate processing
7070 // TODO: Only process if inotify unavailable
71- log .Debugw ("received OUTPUT IPC notification" , "prediction_id" , predictionID )
71+ log .Tracew ("received OUTPUT IPC notification" , "prediction_id" , predictionID )
7272 pollTimer .Reset (100 * time .Millisecond ) // Reset polling timer since we got an event
7373 if err := r .processResponseFiles (predictionID , pending , responsePattern , log ); err != nil {
7474 log .Errorw ("failed to process response files from IPC" , "prediction_id" , predictionID , "error" , err )
@@ -86,7 +86,7 @@ func (r *Runner) watchPredictionResponses(ctx context.Context, predictionID stri
8686 completed := pending .response .Status .IsCompleted ()
8787 pending .mu .Unlock ()
8888 if completed {
89- log .Debugw ("prediction completed, watcher exiting" , "prediction_id" , predictionID )
89+ log .Tracew ("prediction completed, watcher exiting" , "prediction_id" , predictionID )
9090 return
9191 }
9292 }
@@ -274,7 +274,7 @@ func (r *Runner) handleResponseWebhooksAndCompletion(response *PredictionRespons
274274 }
275275
276276 // Watcher exits - manager defer will handle webhook and cleanup
277- log .Debugw ("prediction completed, watcher exiting" , "prediction_id" , predictionID )
277+ log .Tracew ("prediction completed, watcher exiting" , "prediction_id" , predictionID )
278278 return
279279 }
280280}
@@ -356,25 +356,25 @@ func (r *Runner) WaitForStop() {
356356func (r * Runner ) GracefulShutdown () {
357357 log := r .logger .Sugar ()
358358 if ! r .shutdownWhenIdle .CompareAndSwap (false , true ) {
359- log .Debugw ("graceful shutdown already initiated" , "runner_id" , r .runnerCtx .id )
359+ log .Tracew ("graceful shutdown already initiated" , "runner_id" , r .runnerCtx .id )
360360 return
361361 }
362362
363363 r .mu .RLock ()
364364 shouldSignal := (r .status == StatusReady && len (r .pending ) == 0 )
365365 r .mu .RUnlock ()
366366
367- log .Debugw ("graceful shutdown initiated" , "runner_id" , r .runnerCtx .id , "status" , r .status , "pending_count" , len (r .pending ), "should_signal" , shouldSignal )
367+ log .Tracew ("graceful shutdown initiated" , "runner_id" , r .runnerCtx .id , "status" , r .status , "pending_count" , len (r .pending ), "should_signal" , shouldSignal )
368368
369369 if shouldSignal {
370370 if r .readyForShutdown == nil {
371371 log .Warnw ("readyForShutdown channel is nil, cannot signal shutdown readiness" , "runner_id" , r .runnerCtx .id )
372372 } else {
373373 select {
374374 case <- r .readyForShutdown :
375- log .Debugw ("readyForShutdown already closed" , "runner_id" , r .runnerCtx .id )
375+ log .Tracew ("readyForShutdown already closed" , "runner_id" , r .runnerCtx .id )
376376 default :
377- log .Debugw ("closing readyForShutdown channel" , "runner_id" , r .runnerCtx .id )
377+ log .Tracew ("closing readyForShutdown channel" , "runner_id" , r .runnerCtx .id )
378378 close (r .readyForShutdown )
379379 }
380380 }
@@ -407,7 +407,7 @@ func (r *Runner) Start(ctx context.Context) error {
407407 return fmt .Errorf ("failed to start subprocess: %w" , err )
408408 }
409409
410- log .Debugw ("runner process started successfully" , "pid" , cmd .Process .Pid )
410+ log .Tracew ("runner process started successfully" , "pid" , cmd .Process .Pid )
411411
412412 return nil
413413}
@@ -437,7 +437,7 @@ func (r *Runner) setupLogCapture() error {
437437 line := scanner .Text ()
438438 r .logStdout (line )
439439 }
440- r .logger .Debug ("finished stdout log capture" )
440+ r .logger .Trace ("finished stdout log capture" )
441441 })
442442
443443 wg .Go (func () {
@@ -446,7 +446,7 @@ func (r *Runner) setupLogCapture() error {
446446 line := scanner .Text ()
447447 r .logStderr (line )
448448 }
449- r .logger .Debug ("finished stderr log capture" )
449+ r .logger .Trace ("finished stderr log capture" )
450450 })
451451
452452 // Signal when both pipes are closed (with double-close protection)
@@ -792,15 +792,15 @@ func (r *Runner) predict(req PredictionRequest) (chan PredictionResponse, error)
792792 r .mu .Lock ()
793793 defer r .mu .Unlock ()
794794
795- log .Debugw ("runner.predict called" , "prediction_id" , req .ID , "status" , r .status )
795+ log .Tracew ("runner.predict called" , "prediction_id" , req .ID , "status" , r .status )
796796
797797 // Prediction must be pre-allocated by manager
798798 pending , exists := r .pending [req .ID ]
799799 if ! exists {
800800 return nil , fmt .Errorf ("prediction %s not allocated" , req .ID )
801801 }
802802
803- log .Debugw ("prediction found in pending" , "prediction_id" , req .ID )
803+ log .Tracew ("prediction found in pending" , "prediction_id" , req .ID )
804804
805805 // Process input paths (base64 and URL inputs)
806806 inputPaths := make ([]string , 0 )
@@ -829,13 +829,13 @@ func (r *Runner) predict(req PredictionRequest) (chan PredictionResponse, error)
829829 return nil , fmt .Errorf ("failed to write request file: %w" , err )
830830 }
831831
832- log .Debugw ("wrote prediction request file" , "prediction_id" , req .ID , "path" , requestPath , "working_dir" , r .runnerCtx .workingdir , "request_data" , string (requestData ))
832+ log .Tracew ("wrote prediction request file" , "prediction_id" , req .ID , "path" , requestPath , "working_dir" , r .runnerCtx .workingdir , "request_data" , string (requestData ))
833833
834834 // Debug: Check if file actually exists and list directory contents
835835 if _ , err := os .Stat (requestPath ); err != nil {
836- log .Debugw ("ERROR: written request file does not exist" , "prediction_id" , req .ID , "path" , requestPath , "error" , err )
836+ log .Tracew ("ERROR: written request file does not exist" , "prediction_id" , req .ID , "path" , requestPath , "error" , err )
837837 } else {
838- log .Debugw ("confirmed request file exists" , "prediction_id" , req .ID , "path" , requestPath )
838+ log .Tracew ("confirmed request file exists" , "prediction_id" , req .ID , "path" , requestPath )
839839 }
840840
841841 // Debug: List all files in working directory
@@ -844,13 +844,13 @@ func (r *Runner) predict(req PredictionRequest) (chan PredictionResponse, error)
844844 for i , entry := range entries {
845845 fileNames [i ] = entry .Name ()
846846 }
847- log .Debugw ("working directory contents after write" , "prediction_id" , req .ID , "working_dir" , r .runnerCtx .workingdir , "files" , fileNames )
847+ log .Tracew ("working directory contents after write" , "prediction_id" , req .ID , "working_dir" , r .runnerCtx .workingdir , "files" , fileNames )
848848 }
849849
850850 // Update pending prediction with request details
851851 pending .request = req
852852
853- log .Debugw ("returning prediction channel" , "prediction_id" , req .ID )
853+ log .Tracew ("returning prediction channel" , "prediction_id" , req .ID )
854854 return pending .c , nil
855855}
856856
@@ -970,21 +970,21 @@ func (r *Runner) updateSetupResult() {
970970 }
971971
972972 setupResultPath := filepath .Join (r .runnerCtx .workingdir , "setup_result.json" )
973- log .Debug ("reading setup_result.json" , "path" , setupResultPath )
973+ log .Trace ("reading setup_result.json" , "path" , setupResultPath )
974974
975975 // Try to read additional setup result data from file
976976 var setupResultFromFile SetupResult
977977 if err := r .readJSON (setupResultPath , & setupResultFromFile ); err != nil {
978- log .Debugw ("failed to read setup_result.json, assuming success" , "error" , err )
978+ log .Tracew ("failed to read setup_result.json, assuming success" , "error" , err )
979979 // If setup_result.json doesn't exist, assume setup succeeded and status is ready
980980 r .setupResult .Status = SetupSucceeded
981981 r .setupResult .Schema = "" // Will be populated by updateSchema if available
982982 r .status = StatusReady
983- log .Debugw ("setup result not found, assuming success" , "status" , r .status .String ())
983+ log .Tracew ("setup result not found, assuming success" , "status" , r .status .String ())
984984 return
985985 }
986986
987- log .Debugw ("successfully read setup_result.json" , "status" , setupResultFromFile .Status , "schema_length" , len (setupResultFromFile .Schema ))
987+ log .Tracew ("successfully read setup_result.json" , "status" , setupResultFromFile .Status , "schema_length" , len (setupResultFromFile .Schema ))
988988
989989 // Update setup result with data from file, preserving logs that were already set
990990 r .setupResult .Status = setupResultFromFile .Status
0 commit comments