@@ -22,6 +22,7 @@ import (
2222 "github.com/ethersphere/bee/v2/pkg/postage"
2323 "github.com/ethersphere/bee/v2/pkg/pricer"
2424 "github.com/ethersphere/bee/v2/pkg/pushsync/pb"
25+ "github.com/ethersphere/bee/v2/pkg/safe"
2526 "github.com/ethersphere/bee/v2/pkg/skippeers"
2627 "github.com/ethersphere/bee/v2/pkg/soc"
2728 "github.com/ethersphere/bee/v2/pkg/stabilization"
@@ -242,7 +243,9 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream)
242243 chunk .WithStamp (stamp )
243244
244245 if cac .Valid (chunk ) {
245- go ps .unwrap (chunk )
246+ safe .Go (ps .logger , "pushsync-unwrap-chunk" , func () {
247+ ps .unwrap (chunk )
248+ })
246249 } else if chunk , err := soc .FromChunk (chunk ); err == nil {
247250 addr , err := chunk .Address ()
248251 if err != nil {
@@ -424,7 +427,9 @@ func (ps *PushSync) pushToClosest(ctx context.Context, ch swarm.Chunk, origin bo
424427 if inflight == 0 {
425428 if ps .fullNode {
426429 if cac .Valid (ch ) {
427- go ps .unwrap (ch )
430+ safe .Go (ps .logger , "pushsync-unwrap-ch" , func () {
431+ ps .unwrap (ch )
432+ })
428433 }
429434 return nil , topology .ErrWantSelf
430435 }
@@ -477,7 +482,9 @@ func (ps *PushSync) pushToClosest(ctx context.Context, ch swarm.Chunk, origin bo
477482 ps .metrics .TotalSendAttempts .Inc ()
478483 inflight ++
479484
480- go ps .push (ctx , resultChan , peer , ch , action )
485+ safe .Go (ps .logger , "pushsync-push" , func () {
486+ ps .push (ctx , resultChan , peer , ch , action )
487+ })
481488
482489 case result := <- resultChan :
483490 inflight --
0 commit comments