public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Samuel Rufinatscha <s.rufinatscha@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH proxmox 2/3] fix #7166: acme-api: allow stopping certificate orders
Date: Mon, 14 Sep 2026 18:19:30 +0200	[thread overview]
Message-ID: <20260914161931.380138-3-s.rufinatscha@proxmox.com> (raw)
In-Reply-To: <20260914161931.380138-1-s.rufinatscha@proxmox.com>

Handle abort requests during validation and finalization and clean up
the challenge plugin when validation is stopped.

Signed-off-by: Samuel Rufinatscha <s.rufinatscha@proxmox.com>
---
 proxmox-acme-api/src/certificate_helpers.rs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs
index 1db41564..771111fb 100644
--- a/proxmox-acme-api/src/certificate_helpers.rs
+++ b/proxmox-acme-api/src/certificate_helpers.rs
@@ -100,7 +100,11 @@ pub async fn order_certificate(
             .setup(&mut acme, &auth, domain_config, Arc::clone(&worker))
             .await?;
 
-        let result = request_validation(&mut acme, auth_url, validation_url).await;
+        let result = tokio::select! {
+            biased;
+            _ = worker.abort_future() => Err(format_err!("abort requested - aborting task")),
+            result = request_validation(&mut acme, auth_url, validation_url) => result,
+        };
 
         if let Err(err) = plugin_cfg
             .teardown(&mut acme, &auth, domain_config, Arc::clone(&worker))
@@ -119,7 +123,11 @@ pub async fn order_certificate(
     info!("Creating CSR");
 
     let csr = proxmox_acme::util::Csr::generate(&identifiers, &Default::default())?;
-    let certificate = finalize_order(&mut acme, &order.location, &csr.data).await?;
+    let certificate = tokio::select! {
+        biased;
+        _ = worker.abort_future() => bail!("abort requested - aborting task"),
+        result = finalize_order(&mut acme, &order.location, &csr.data) => result?,
+    };
 
     Ok(Some(OrderedCertificate {
         certificate,
-- 
2.47.3





  parent reply	other threads:[~2026-09-14 16:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 16:19 [PATCH proxmox 0/3] fix #7166: acme: stop and time out stalled certificate orders Samuel Rufinatscha
2026-09-14 16:19 ` [PATCH proxmox 1/3] acme-api: extract certificate order finalization helper Samuel Rufinatscha
2026-09-14 16:19 ` Samuel Rufinatscha [this message]
2026-09-14 16:19 ` [PATCH proxmox 3/3] fix #7166: acme-api: time out validation and finalization Samuel Rufinatscha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260914161931.380138-3-s.rufinatscha@proxmox.com \
    --to=s.rufinatscha@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal