From 32b4e0fda2e61a8704849477bb015ea504e3c072 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Tue, 24 May 2022 15:14:33 -0400 Subject: [PATCH] Fix --- pageserver/src/bin/pageserver.rs | 14 ++++++++------ pageserver/src/tenant_jobs/worker.rs | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pageserver/src/bin/pageserver.rs b/pageserver/src/bin/pageserver.rs index 35fc838274..5a9fc0e57d 100644 --- a/pageserver/src/bin/pageserver.rs +++ b/pageserver/src/bin/pageserver.rs @@ -9,7 +9,7 @@ use clap::{App, Arg}; use daemonize::Daemonize; use fail::FailScenario; -use pageserver::{LOG_FILE_NAME, config::{defaults::*, PageServerConf}, http, page_cache, page_service, profiling, tenant_jobs::gc::GC_POOL, tenant_mgr, thread_mgr, thread_mgr::ThreadKind, timelines, virtual_file}; +use pageserver::{LOG_FILE_NAME, config::{defaults::*, PageServerConf}, http, page_cache, page_service, profiling, tenant_jobs::{compaction::{COMPACTION_POOL, CompactionJob}, gc::{GC_POOL, GcJob}, worker::Pool}, tenant_mgr, thread_mgr, thread_mgr::ThreadKind, timelines, virtual_file}; use utils::{ auth::JwtAuth, http::endpoint, @@ -179,11 +179,11 @@ fn main() -> anyhow::Result<()> { // If failpoints are used, terminate the whole pageserver process if they are hit. let scenario = FailScenario::setup(); - if fail::has_failpoints() { - std::panic::set_hook(Box::new(|_| { - std::process::exit(1); - })); - } + // if fail::has_failpoints() { + // std::panic::set_hook(Box::new(|_| { + // std::process::exit(1); + // })); + // } // Basic initialization of things that don't change after startup virtual_file::init(conf.max_file_descriptors); @@ -301,6 +301,7 @@ fn start_pageserver(conf: &'static PageServerConf, daemonize: bool) -> Result<() )?; // Spawn GC workers + GC_POOL.set(Pool::::new()).unwrap(); for i in 0..3 { let name = format!("gc_worker_{}", i); thread_mgr::spawn( @@ -316,6 +317,7 @@ fn start_pageserver(conf: &'static PageServerConf, daemonize: bool) -> Result<() } // Spawn compaction workers + COMPACTION_POOL.set(Pool::::new()).unwrap(); for i in 0..3 { let name = format!("compaction_worker_{}", i); thread_mgr::spawn( diff --git a/pageserver/src/tenant_jobs/worker.rs b/pageserver/src/tenant_jobs/worker.rs index 0d26d22faa..309e9c9e34 100644 --- a/pageserver/src/tenant_jobs/worker.rs +++ b/pageserver/src/tenant_jobs/worker.rs @@ -82,7 +82,7 @@ pub struct Pool where J::ErrorType: Debug { } impl Pool where J::ErrorType: Debug { - fn new() -> Self { + pub fn new() -> Self { Pool { job_table: Mutex::new(JobStatusTable:: { status: HashMap::>::new(),