From c8180107a6c281320fff2675abd7943cf5acafe2 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 19 Jul 2022 12:25:13 +0200 Subject: don't limit time for fetching leaves from primary to 10s We might want to limit _each_request_ to something, but we'll leave that for now. --- internal/node/secondary/secondary.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'internal') diff --git a/internal/node/secondary/secondary.go b/internal/node/secondary/secondary.go index c181420..d2d3d43 100644 --- a/internal/node/secondary/secondary.go +++ b/internal/node/secondary/secondary.go @@ -68,17 +68,14 @@ func (s Secondary) InternalHTTPHandlers() []handler.Handler { } func (s Secondary) fetchLeavesFromPrimary(ctx context.Context) { - sctx, cancel := context.WithTimeout(ctx, time.Second*10) // FIXME: parameterize 10 - defer cancel() - - prim, err := s.Primary.GetUnsignedTreeHead(sctx) + prim, err := s.Primary.GetUnsignedTreeHead(ctx) if err != nil { log.Warning("unable to get tree head from primary: %v", err) return } log.Debug("got tree head from primary, size %d", prim.TreeSize) - curTH, err := treeHeadFromTrillian(sctx, s.TrillianClient) + curTH, err := treeHeadFromTrillian(ctx, s.TrillianClient) if err != nil { log.Warning("unable to get tree head from trillian: %v", err) return @@ -89,7 +86,8 @@ func (s Secondary) fetchLeavesFromPrimary(ctx context.Context) { StartSize: uint64(index), EndSize: prim.TreeSize - 1, } - leaves, err = s.Primary.GetLeaves(sctx, req) + // TODO: set context per request + leaves, err = s.Primary.GetLeaves(ctx, req) if err != nil { log.Warning("error fetching leaves [%d..%d] from primary: %v", req.StartSize, req.EndSize, err) return -- cgit v1.2.3