(&mut self, uuid: Uuid, reason: PeekResponse)
| 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 | /// |
nothing calls this directly
no test coverage detected