doc: consider cancellation and redownload

This commit is contained in:
Joonas Koivunen
2023-08-24 17:03:01 +03:00
parent de93c70f2f
commit eccb868a50

View File

@@ -819,6 +819,8 @@ impl LayerE {
let can_ever_evict = timeline.remote_client.as_ref().is_some();
// check if we really need to be downloaded; could have been already downloaded by a
// cancelled previous attempt.
let needs_download = self
.needs_download()
.await
@@ -923,13 +925,17 @@ impl LayerE {
match res {
Ok(()) => {
// our caller is cancellation safe so this is fine; if someone
// else requests the layer, they'll find it already downloaded.
// else requests the layer, they'll find it already downloaded
// or redownload.
//
// however, could be that we should consider marking the layer
// for eviction?
},
Err(e) => {
// our caller is cancellation safe, but
// our caller is cancellation safe, but we might be racing with
// another attempt to reinitialize. before we have cancellation
// token support: these attempts should converge regardless of
// their completion order.
tracing::error!("layer file download failed, and additionally failed to communicate this to caller: {e:?}");
}
}