From 328b933f856a1c7d0e43d69e32e462b1f77741c4 Mon Sep 17 00:00:00 2001 From: tanlang Date: Mon, 18 Dec 2023 17:55:53 +0800 Subject: [PATCH 1/3] feat: start dagstore in goroutine --- dagstore/wrapper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dagstore/wrapper.go b/dagstore/wrapper.go index 84da3e42..03f5d0f5 100644 --- a/dagstore/wrapper.go +++ b/dagstore/wrapper.go @@ -199,7 +199,9 @@ func (w *Wrapper) Start(ctx context.Context) error { go dagstore.RecoverImmediately(w.ctx, dss, w.failureCh, maxRecoverAttempts, w.backgroundWg.Done) } - return w.dagst.Start(ctx) + go w.dagst.Start(ctx) + + return nil } func (w *Wrapper) gcLoop() { From f6d11c0200ac6729c90844797dff4a7bcfcc52d9 Mon Sep 17 00:00:00 2001 From: tanlang Date: Mon, 18 Dec 2023 17:59:44 +0800 Subject: [PATCH 2/3] chore: update dag store --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1ffb7883..b37e2f96 100644 --- a/go.mod +++ b/go.mod @@ -314,7 +314,7 @@ require ( ) replace ( - github.com/filecoin-project/dagstore => github.com/ipfs-force-community/dagstore v0.4.4-0.20230628060530-4b25fff4d833 + github.com/filecoin-project/dagstore => github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393 github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi github.com/filecoin-project/go-fil-markets => github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01 github.com/filecoin-project/go-jsonrpc => github.com/ipfs-force-community/go-jsonrpc v0.1.9 diff --git a/go.sum b/go.sum index 4d86259f..d3f31255 100644 --- a/go.sum +++ b/go.sum @@ -692,8 +692,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.2.2/go.mod h1:fa/d1lAdUHxuc1jedx3 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/ipfs-force-community/dagstore v0.4.4-0.20230628060530-4b25fff4d833 h1:2twcWpKmKa7iGXjw+wuN0suXavrJS5U7RYjCJml8qSI= -github.com/ipfs-force-community/dagstore v0.4.4-0.20230628060530-4b25fff4d833/go.mod h1:YKn4qXih+/2xQWpfJsaKGOi4POw5vH5grDmfPCCnx8g= +github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393 h1:DZd7I0MLgFtW8sVeSk7MSEDLC8PQ4Drl01CIKak/JM0= +github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393/go.mod h1:YKn4qXih+/2xQWpfJsaKGOi4POw5vH5grDmfPCCnx8g= github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01 h1:sD9/GoGBui1j5fpKepe1v4P5NsjurqbM8WQlk4LNZeI= github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01/go.mod h1:eryxo/oVgIxaR5g5CNr9PlvZOi+u/bak0IsPL/PT1hk= github.com/ipfs-force-community/go-jsonrpc v0.1.9 h1:5QavBltfvV6fz/+EbYsCkVxJ1MSJncZm6YuPs1SLdZU= From 9976aaf5075eb893335ca4c5d59c5be2596b2861 Mon Sep 17 00:00:00 2001 From: tanlang Date: Tue, 19 Dec 2023 10:17:01 +0800 Subject: [PATCH 3/3] feat: check err return from dag start --- dagstore/wrapper.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dagstore/wrapper.go b/dagstore/wrapper.go index 03f5d0f5..35a5784e 100644 --- a/dagstore/wrapper.go +++ b/dagstore/wrapper.go @@ -199,7 +199,12 @@ func (w *Wrapper) Start(ctx context.Context) error { go dagstore.RecoverImmediately(w.ctx, dss, w.failureCh, maxRecoverAttempts, w.backgroundWg.Done) } - go w.dagst.Start(ctx) + go func() { + err := w.dagst.Start(ctx) + if err != nil { + log.Errorf("failed to start dagstore: %s", err) + } + }() return nil }