diff --git a/core/src/subgraph/instance_manager.rs b/core/src/subgraph/instance_manager.rs index f4543b29590..5779248b4e2 100644 --- a/core/src/subgraph/instance_manager.rs +++ b/core/src/subgraph/instance_manager.rs @@ -28,7 +28,6 @@ use graph::{components::ethereum::NodeCapabilities, data::store::scalar::Bytes}; use super::loader::load_dynamic_data_sources; use super::SubgraphInstance; -use crate::subgraph::registrar::IPFS_SUBGRAPH_LOADING_TIMEOUT; lazy_static! { /// Size limit of the entity LFU cache, in bytes. @@ -262,14 +261,6 @@ where let logger = logger_factory.component_logger("SubgraphInstanceManager", None); let logger_factory = logger_factory.with_parent(logger.clone()); - let link_resolver = Arc::new( - link_resolver - .as_ref() - .clone() - .with_timeout(*IPFS_SUBGRAPH_LOADING_TIMEOUT) - .with_retries(), - ); - SubgraphInstanceManager { logger_factory, subgraph_store, @@ -323,7 +314,8 @@ where let mut manifest = SubgraphManifest::resolve_from_raw( deployment.hash.cheap_clone(), manifest, - &*link_resolver, + // Allow for infinite retries for subgraph definition files. + &link_resolver.as_ref().clone().with_retries(), &logger, ) .await diff --git a/core/src/subgraph/registrar.rs b/core/src/subgraph/registrar.rs index 684d8270023..edf50af8d0e 100644 --- a/core/src/subgraph/registrar.rs +++ b/core/src/subgraph/registrar.rs @@ -1,12 +1,9 @@ use std::collections::HashSet; -use std::env; -use std::time::{Duration, Instant}; +use std::time::Instant; use async_trait::async_trait; -use graph::blockchain::BlockchainMap; -use lazy_static::lazy_static; - use graph::blockchain::Blockchain; +use graph::blockchain::BlockchainMap; use graph::components::store::{DeploymentId, DeploymentLocator, SubscriptionManager}; use graph::data::subgraph::schema::SubgraphDeploymentEntity; use graph::prelude::{ @@ -14,16 +11,6 @@ use graph::prelude::{ SubgraphRegistrar as SubgraphRegistrarTrait, *, }; -lazy_static! { - // The timeout for IPFS requests in seconds - pub static ref IPFS_SUBGRAPH_LOADING_TIMEOUT: Duration = Duration::from_secs( - env::var("GRAPH_IPFS_SUBGRAPH_LOADING_TIMEOUT") - .unwrap_or("60".into()) - .parse::() - .expect("invalid IPFS subgraph loading timeout") - ); -} - pub struct SubgraphRegistrar { logger: Logger, logger_factory: LoggerFactory, @@ -61,13 +48,7 @@ where SubgraphRegistrar { logger, logger_factory, - resolver: Arc::new( - resolver - .as_ref() - .clone() - .with_timeout(*IPFS_SUBGRAPH_LOADING_TIMEOUT) - .with_retries(), - ), + resolver: Arc::new(resolver.as_ref().clone().with_retries()), provider, store, subscription_manager, diff --git a/docs/environment-variables.md b/docs/environment-variables.md index abb18219f36..e29f3caca2f 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -48,10 +48,8 @@ those. - `GRAPH_MAPPING_HANDLER_TIMEOUT`: amount of time a mapping handler is allowed to take (in seconds, default is unlimited) -- `GRAPH_IPFS_SUBGRAPH_LOADING_TIMEOUT`: timeout for IPFS requests made to load - subgraph files from IPFS (in seconds, default is 60). -- `GRAPH_IPFS_TIMEOUT`: timeout for IPFS requests from mappings using `ipfs.cat` - or `ipfs.map` (in seconds, default is 30). +- `GRAPH_IPFS_TIMEOUT`: timeout for IPFS, which includes requests for manifest files + and from mappings using `ipfs.cat` or `ipfs.map` (in seconds, default is 30). - `GRAPH_MAX_IPFS_FILE_BYTES`: maximum size for a file that can be retrieved with `ipfs.cat` (in bytes, default is unlimited) - `GRAPH_MAX_IPFS_MAP_FILE_SIZE`: maximum size of files that can be processed