@@ -51,9 +51,10 @@ type state struct {
51
51
parents map [digest.Digest ]struct {}
52
52
childVtx map [digest.Digest ]struct {}
53
53
54
- mpw * progress.MultiWriter
55
- allPw map [progress.Writer ]struct {}
56
- mspan * tracing.MultiSpan
54
+ mpw * progress.MultiWriter
55
+ allPw map [progress.Writer ]struct {}
56
+ mspan * tracing.MultiSpan
57
+ execSpan trace.Span
57
58
58
59
vtx Vertex
59
60
clientVertex client.Vertex
@@ -902,6 +903,7 @@ func (s *sharedOp) LoadCache(ctx context.Context, rec *CacheRecord) (Result, err
902
903
}
903
904
// no cache hit. start evaluating the node
904
905
span , ctx := tracing .StartSpan (ctx , "load cache: " + s .st .vtx .Name (), trace .WithAttributes (attribute .String ("vertex" , s .st .vtx .Digest ().String ())))
906
+ s .st .execSpan = span
905
907
notifyCompleted := notifyStarted (ctx , & s .st .clientVertex , true )
906
908
res , err := s .Cache ().Load (withAncestorCacheOpts (ctx , s .st ), rec )
907
909
tracing .FinishWithError (span , err )
@@ -938,7 +940,9 @@ func (s *sharedOp) CalcSlowCache(ctx context.Context, index Index, p PreprocessF
938
940
return "" , errors .Errorf ("failed to get state for index %d on %v" , index , s .st .vtx .Name ())
939
941
}
940
942
ctx2 := progress .WithProgress (ctx , st .mpw )
941
- if st .mspan .Span != nil {
943
+ if st .execSpan != nil {
944
+ ctx2 = trace .ContextWithSpan (ctx2 , st .execSpan )
945
+ } else if st .mspan .Span != nil {
942
946
ctx2 = trace .ContextWithSpan (ctx2 , st .mspan )
943
947
}
944
948
err = p (ctx2 , res , st )
@@ -1093,6 +1097,7 @@ func (s *sharedOp) Exec(ctx context.Context, inputs []Result) (outputs []Result,
1093
1097
1094
1098
// no cache hit. start evaluating the node
1095
1099
span , ctx := tracing .StartSpan (ctx , s .st .vtx .Name (), trace .WithAttributes (attribute .String ("vertex" , s .st .vtx .Digest ().String ())))
1100
+ s .st .execSpan = span
1096
1101
notifyCompleted := notifyStarted (ctx , & s .st .clientVertex , false )
1097
1102
defer func () {
1098
1103
tracing .FinishWithError (span , retErr )
0 commit comments