@@ -19,12 +19,12 @@ package agreement
1919//go:generate dbgen -i agree.sql -p agreement -n agree -o agreeInstall.go -h ../scripts/LICENSE_HEADER
2020import (
2121 "context"
22- "runtime/pprof"
2322 "time"
2423
2524 "github.com/algorand/go-algorand/config"
2625 "github.com/algorand/go-algorand/logging"
2726 "github.com/algorand/go-algorand/protocol"
27+ "github.com/algorand/go-algorand/util"
2828 "github.com/algorand/go-algorand/util/db"
2929 "github.com/algorand/go-algorand/util/execpool"
3030 "github.com/algorand/go-algorand/util/timers"
@@ -144,12 +144,8 @@ func (s *Service) Start() {
144144 input := make (chan externalEvent )
145145 output := make (chan []action )
146146 ready := make (chan externalDemuxSignals )
147- pprof .Do (context .Background (), pprof .Labels ("worker" , "agreement.demux" ), func (_ context.Context ) {
148- go s .demuxLoop (ctx , input , output , ready )
149- })
150- pprof .Do (context .Background (), pprof .Labels ("worker" , "agreement.main" ), func (_ context.Context ) {
151- go s .mainLoop (input , output , ready )
152- })
147+ go s .demuxLoop (ctx , input , output , ready )
148+ go s .mainLoop (input , output , ready )
153149}
154150
155151// Shutdown the execution of the protocol.
@@ -164,6 +160,7 @@ func (s *Service) Shutdown() {
164160
165161// demuxLoop repeatedly executes pending actions and then requests the next event from the Service.demux.
166162func (s * Service ) demuxLoop (ctx context.Context , input chan <- externalEvent , output <- chan []action , ready <- chan externalDemuxSignals ) {
163+ util .SetGoroutineLabels ("func" , "agreement.demuxLoop" )
167164 for a := range output {
168165 s .do (ctx , a )
169166 extSignals := <- ready
@@ -188,6 +185,7 @@ func (s *Service) demuxLoop(ctx context.Context, input chan<- externalEvent, out
188185// 3. Drive the state machine with this input to obtain a slice of pending actions.
189186// 4. If necessary, persist state to disk.
190187func (s * Service ) mainLoop (input <- chan externalEvent , output chan <- []action , ready chan <- externalDemuxSignals ) {
188+ util .SetGoroutineLabels ("func" , "agreement.mainLoop" )
191189 // setup
192190 var clock timers.Clock
193191 var router rootRouter
0 commit comments