Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions block/internal/executing/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ func (e *Executor) Start(ctx context.Context) error {
}

// Start execution loop
e.wg.Add(1)
go func() {
defer e.wg.Done()
e.executionLoop()
}()
e.wg.Go(e.executionLoop)

e.logger.Info().Msg("executor started")
return nil
Expand Down
6 changes: 1 addition & 5 deletions block/internal/reaping/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ func (r *Reaper) Start(ctx context.Context) error {
r.ctx, r.cancel = context.WithCancel(ctx)

// Start reaper loop
r.wg.Add(1)
go func() {
defer r.wg.Done()
r.reaperLoop()
}()
r.wg.Go(r.reaperLoop)

r.logger.Info().Dur("interval", r.interval).Msg("reaper started")
return nil
Expand Down
6 changes: 2 additions & 4 deletions block/internal/syncing/raft_retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ func (r *raftRetriever) Start(ctx context.Context) error {
applyCh := make(chan raft.RaftApplyMsg, 100)
r.raftNode.SetApplyCallback(applyCh)

r.wg.Add(1)
go func() {
defer r.wg.Done()
r.wg.Go(func() {
r.raftApplyLoop(ctx, applyCh)
}()
})
return nil
}

Expand Down
6 changes: 2 additions & 4 deletions pkg/da/selector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ func TestNoOpSelector_Concurrent(t *testing.T) {
var wg sync.WaitGroup

for i := 0; i < numGoroutines; i++ {
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
for j := 0; j < 100; j++ {
addr := selector.Next()
assert.Empty(t, addr)
}
}()
})
}

wg.Wait()
Expand Down