MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / cancel_peek

Method cancel_peek

src/compute-client/src/controller/instance.rs:1802–1825  ·  view source on GitHub ↗
(&mut self, uuid: Uuid, reason: PeekResponse)

Source from the content-addressed store, hash-verified

1800 /// Cancels an existing peek request.
1801 #[mz_ore::instrument(level = "debug")]
1802 pub fn cancel_peek(&mut self, uuid: Uuid, reason: PeekResponse) {
1803 let Some(peek) = self.peeks.get_mut(&uuid) else {
1804 tracing::warn!("did not find pending peek for {uuid}");
1805 return;
1806 };
1807
1808 let duration = peek.requested_at.elapsed();
1809 self.metrics
1810 .observe_peek_response(&PeekResponse::Canceled, duration);
1811
1812 // Enqueue a notification for the cancellation.
1813 let otel_ctx = peek.otel_ctx.clone();
1814 otel_ctx.attach_as_parent();
1815
1816 self.deliver_response(ComputeControllerResponse::PeekNotification(
1817 uuid,
1818 PeekNotification::Canceled,
1819 otel_ctx,
1820 ));
1821
1822 // Finish the peek.
1823 // This will also propagate the cancellation to the replicas.
1824 self.finish_peek(uuid, reason);
1825 }
1826
1827 /// Assigns a read policy to specific identifiers.
1828 ///

Callers

nothing calls this directly

Calls 7

PeekNotificationEnum · 0.85
observe_peek_responseMethod · 0.80
attach_as_parentMethod · 0.80
deliver_responseMethod · 0.80
finish_peekMethod · 0.80
get_mutMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected