@@ -423,38 +423,77 @@ func (pf *pipeFactory) NewFuncRequest(f func(context.Context) (interface{}, erro
423423}
424424
425425func debugSchedulerPreUnpark (e * edge , inc []pipe.Sender , updates , allPipes []pipe.Receiver ) {
426- log := bklog .G (context .TODO ())
427-
428- log .Debugf (">> unpark %s req=%d upt=%d out=%d state=%s %s" , e .edge .Vertex .Name (), len (inc ), len (updates ), len (allPipes ), e .state , e .edge .Vertex .Digest ())
426+ log := bklog .G (context .TODO ()).
427+ WithField ("edge_vertex_name" , e .edge .Vertex .Name ()).
428+ WithField ("edge_vertex_digest" , e .edge .Vertex .Digest ()).
429+ WithField ("edge_index" , e .edge .Index )
430+
431+ log .
432+ WithField ("edge_state" , e .state ).
433+ WithField ("req" , len (inc )).
434+ WithField ("upt" , len (updates )).
435+ WithField ("out" , len (allPipes )).
436+ Debug (">> unpark" )
429437
430438 for i , dep := range e .deps {
431439 des := edgeStatusInitial
432440 if dep .req != nil {
433441 des = dep .req .Request ().(* edgeRequest ).desiredState
434442 }
435- log .Debugf (":: dep%d %s state=%s des=%s keys=%d hasslowcache=%v preprocessfunc=%v" , i , e .edge .Vertex .Inputs ()[i ].Vertex .Name (), dep .state , des , len (dep .keys ), e .slowCacheFunc (dep ) != nil , e .preprocessFunc (dep ) != nil )
443+ log .
444+ WithField ("dep_index" , i ).
445+ WithField ("dep_vertex_name" , e .edge .Vertex .Inputs ()[i ].Vertex .Name ()).
446+ WithField ("dep_vertex_digest" , e .edge .Vertex .Inputs ()[i ].Vertex .Digest ()).
447+ WithField ("dep_state" , dep .state ).
448+ WithField ("dep_desired_state" , des ).
449+ WithField ("dep_keys" , len (dep .keys )).
450+ WithField ("dep_has_slow_cache" , e .slowCacheFunc (dep ) != nil ).
451+ WithField ("dep_preprocess_func" , e .preprocessFunc (dep ) != nil ).
452+ Debug (":: dep" )
436453 }
437454
438455 for i , in := range inc {
439456 req := in .Request ()
440- log .Debugf ("> incoming-%d: %p dstate=%s canceled=%v" , i , in , req .Payload .(* edgeRequest ).desiredState , req .Canceled )
457+ log .
458+ WithField ("incoming_index" , i ).
459+ WithField ("incoming_pointer" , in ).
460+ WithField ("incoming_desired_state" , req .Payload .(* edgeRequest ).desiredState ).
461+ WithField ("incoming_canceled" , req .Canceled ).
462+ Debug ("> incoming" )
441463 }
442464
443465 for i , up := range updates {
444466 if up == e .cacheMapReq {
445- log .Debugf ("> update-%d: %p cacheMapReq complete=%v" , i , up , up .Status ().Completed )
467+ log .
468+ WithField ("update_index" , i ).
469+ WithField ("update_pointer" , up ).
470+ WithField ("update_complete" , up .Status ().Completed ).
471+ Debug ("> update cacheMapReq" )
446472 } else if up == e .execReq {
447- log .Debugf ("> update-%d: %p execReq complete=%v" , i , up , up .Status ().Completed )
473+ log .
474+ WithField ("update_index" , i ).
475+ WithField ("update_pointer" , up ).
476+ WithField ("update_complete" , up .Status ().Completed ).
477+ Debug ("> update execReq" )
448478 } else {
449479 st , ok := up .Status ().Value .(* edgeState )
450480 if ok {
451481 index := - 1
452482 if dep , ok := e .depRequests [up ]; ok {
453483 index = int (dep .index )
454484 }
455- log .Debugf ("> update-%d: %p input-%d keys=%d state=%s" , i , up , index , len (st .keys ), st .state )
485+ log .
486+ WithField ("update_index" , i ).
487+ WithField ("update_pointer" , up ).
488+ WithField ("update_complete" , up .Status ().Completed ).
489+ WithField ("update_input_index" , index ).
490+ WithField ("update_keys" , len (st .keys )).
491+ WithField ("update_state" , st .state ).
492+ Debugf ("> update edgeState" )
456493 } else {
457- log .Debugf ("> update-%d: unknown" , i )
494+ log .
495+ WithField ("update_index" , i ).
496+ Debug ("> update unknown" )
458497 }
459498 }
460499 }
@@ -463,7 +502,16 @@ func debugSchedulerPreUnpark(e *edge, inc []pipe.Sender, updates, allPipes []pip
463502func debugSchedulerPostUnpark (e * edge , inc []pipe.Sender ) {
464503 log := bklog .G (context .TODO ())
465504 for i , in := range inc {
466- log .Debugf ("< incoming-%d: %p completed=%v" , i , in , in .Status ().Completed )
467- }
468- log .Debugf ("<< unpark %s\n " , e .edge .Vertex .Name ())
505+ log .
506+ WithField ("incoming_index" , i ).
507+ WithField ("incoming_pointer" , in ).
508+ WithField ("incoming_complete" , in .Status ().Completed ).
509+ Debug ("< incoming" )
510+ }
511+ log .
512+ WithField ("edge_vertex_name" , e .edge .Vertex .Name ()).
513+ WithField ("edge_vertex_digest" , e .edge .Vertex .Digest ()).
514+ WithField ("edge_index" , e .edge .Index ).
515+ WithField ("edge_state" , e .state ).
516+ Debug ("<< unpark" )
469517}
0 commit comments