From bd516a491b82c32a46d2f9ed80fffa2360698a38 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 10 May 2023 18:00:52 +0200 Subject: [PATCH] THE PLAN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Timeline::get calls reconstruct data ⇒ turn that into a Pin> . - Problem there: we call layer.get_reconstruct_data while holding layer map lock ⇒ it’s a std rwlock ⇒ need to turn it into tokio mutex - Problem there: we sometimes hold the Tenant::timelines std mutex while holding layer map lock (branching?) ⇒ need to turn it into tokio mutex - Prolem there: tenant.rs `self.state.send_modify(|| { ... timelines.lock().await })`; Can't await inside the closure, and we don't have async closures. And we don't control the tokio::sync::watch API. So, tackle things in reverse here.