From 8abf4c5c20f543db436bbe37848c65c287f62872 Mon Sep 17 00:00:00 2001 From: colindickson Date: Wed, 28 Aug 2024 09:51:41 -0400 Subject: [PATCH] manifest: increase timeout of remote spkg fetch to 5 minutes, up from 30 seconds --- docs/release-notes/change-log.md | 1 + manifest/reader.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/change-log.md b/docs/release-notes/change-log.md index b4283d61..67c416b9 100644 --- a/docs/release-notes/change-log.md +++ b/docs/release-notes/change-log.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Revert 'initialBlocks' changes from v1.9.1 because a 'changing module hash' causes more trouble. * Wazero: bump v1.8.0 and activate caching of precompiled wasm modules in `/tmp/wazero` to decrease compilation time * Metering update: more detailed metering with addition of new metrics (`live_uncompressed_read_bytes`, `live_uncompressed_read_forked_bytes`, `file_uncompressed_read_bytes`, `file_uncompressed_read_forked_bytes`, `file_compressed_read_forked_bytes`, `file_compressed_read_bytes`, `file_uncompressed_write_bytes`, `file_compressed_write_bytes`). *DEPRECATION WARNING*: `bytes_read` and `bytes_written` metrics will be removed in the future, please use the new metrics for metering instead. +* Manifest reader: increase timeout of remote spkg fetch to 5 minutes, up from 30 seconds ### Client * Add `substreams auth` command, to authenticate via `thegraph.market` and to get a dev API Key. diff --git a/manifest/reader.go b/manifest/reader.go index 662afe90..2a3ba861 100644 --- a/manifest/reader.go +++ b/manifest/reader.go @@ -28,10 +28,12 @@ import ( yaml3 "gopkg.in/yaml.v3" ) +var remoteFetchTimeout = 5 * time.Minute + var IPFSURL string var IPFSTimeout time.Duration var httpClient = &http.Client{ - Timeout: 30 * time.Second, + Timeout: remoteFetchTimeout, } func hasRemotePrefix(in string) bool { @@ -235,7 +237,7 @@ func (r *Reader) readFromHttp(input string) error { } func (r *Reader) readFromStore(input string) error { - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), remoteFetchTimeout) defer cancel() store, filename, err := dstore.NewStoreFromFileURL(input)