Skip to content

Commit 40bd408

Browse files
authored
Merge pull request #419 from ipfs-force-community/fix/remove-trace-goroutine
fix: remove trace goroutine for dagstore wrapper
2 parents 364479f + 1b8b0b6 commit 40bd408

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

dagstore/wrapper.go

-28
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ type Wrapper struct {
4949
dagst dagstore.Interface
5050
minerAPI MarketAPI
5151
failureCh chan dagstore.ShardResult
52-
traceCh chan dagstore.Trace
5352
gcInterval time.Duration
5453
}
5554

@@ -69,9 +68,6 @@ func NewDAGStore(ctx context.Context,
6968
// The dagstore will write Shard failures to the `failureCh` here.
7069
failureCh := make(chan dagstore.ShardResult, 1)
7170

72-
// The dagstore will write Trace events to the `traceCh` here.
73-
traceCh := make(chan dagstore.Trace, 32)
74-
7571
var (
7672
transientsDir = filepath.Join(cfg.RootDir, "transients")
7773
datastoreDir = filepath.Join(cfg.RootDir, "datastore")
@@ -110,7 +106,6 @@ func NewDAGStore(ctx context.Context,
110106
ShardRepo: shardRepo,
111107
MountRegistry: registry,
112108
FailureCh: failureCh,
113-
TraceCh: traceCh,
114109
// not limiting fetches globally, as the Lotus mount does
115110
// conditional throttling.
116111
MaxConcurrentIndex: cfg.MaxConcurrentIndex,
@@ -137,7 +132,6 @@ func NewDAGStore(ctx context.Context,
137132
dagst: dagst,
138133
minerAPI: marketApi,
139134
failureCh: failureCh,
140-
traceCh: traceCh,
141135
gcInterval: time.Duration(cfg.GCInterval),
142136
}
143137

@@ -174,10 +168,6 @@ func (w *Wrapper) Start(ctx context.Context) error {
174168
w.backgroundWg.Add(1)
175169
go w.gcLoop()
176170

177-
// run a go-routine to read the trace for debugging.
178-
w.backgroundWg.Add(1)
179-
go w.traceLoop()
180-
181171
// Run a go-routine for shard recovery
182172
if dss, ok := w.dagst.(*dagstore.DAGStore); ok {
183173
w.backgroundWg.Add(1)
@@ -187,24 +177,6 @@ func (w *Wrapper) Start(ctx context.Context) error {
187177
return w.dagst.Start(ctx)
188178
}
189179

190-
func (w *Wrapper) traceLoop() {
191-
defer w.backgroundWg.Done()
192-
193-
for w.ctx.Err() == nil {
194-
select {
195-
// Log trace events from the DAG store
196-
case tr := <-w.traceCh:
197-
log.Debugw("trace",
198-
"shard-key", tr.Key.String(),
199-
"op-type", tr.Op.String(),
200-
"after", tr.After.String())
201-
202-
case <-w.ctx.Done():
203-
return
204-
}
205-
}
206-
}
207-
208180
func (w *Wrapper) gcLoop() {
209181
defer w.backgroundWg.Done()
210182

0 commit comments

Comments
 (0)