Your message dated Tue, 22 Jul 2025 12:19:06 +0000
with message-id <[email protected]>
and subject line Bug#1109542: fixed in scaphandre 1.0.2-5
has caused the Debian Bug report #1109542,
regarding scaphandre: upgrading to hyper 1
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1109542: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109542
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: scaphandre
Version: 1.0.2-4
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected]
Dear Maintainer,
Here is a patch to upgrade scaphandre to use the latest hyper 1.x, so we can
get rid of the remaining 0.14.
It's a naive copy of https://hyper.rs/guides/1/server/hello-world/, it
compiles, but I don't have a host running Debian to test the actual
functionality.
I'll leave the honor of upstreaming to you.
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,8 @@
time = "0.3"
colored = "2.0"
chrono = "0.4"
-hyper = { version = "0.14", features = ["full"], optional = true }
+hyper = { version = "1.5", features = ["full"], optional = true }
+hyper-util = { version = "0.1", features = ["tokio"] }
tokio = { version = "1.26.0", features = ["full"], optional = true }
sysinfo = { version = "0.30.13" }
isahc = { version = "1.7.2", optional = true }
--- a/src/exporters/prometheus.rs
+++ b/src/exporters/prometheus.rs
@@ -9,8 +9,11 @@
use crate::sensors::utils::current_system_time_since_epoch;
use crate::sensors::{Sensor, Topology};
use chrono::Utc;
-use hyper::service::{make_service_fn, service_fn};
-use hyper::{Body, Request, Response, Server};
+use hyper::{Request, Response};
+use hyper::server::conn::http1::Builder;
+use hyper::service::service_fn;
+use hyper_util::rt::TokioIo;
+use tokio::net::TcpListener;
use std::convert::Infallible;
use std::{
collections::HashMap,
@@ -105,32 +108,28 @@
socket_addr: SocketAddr,
metric_generator: MetricGenerator,
endpoint_suffix: &str,
-) {
+) -> std::io::Result<()> {
let power_metrics = PowerMetrics {
last_request: Mutex::new(Duration::new(0, 0)),
metric_generator: Mutex::new(metric_generator),
};
let context = Arc::new(power_metrics);
- let make_svc = make_service_fn(move |_| {
+
+ let listener = TcpListener::bind(socket_addr).await?;
+ loop {
+ let (stream, _) = listener.accept().await?;
+ let io = TokioIo::new(stream);
+
let ctx = context.clone();
let sfx = endpoint_suffix.to_string();
- async {
- Ok::<_, Infallible>(service_fn(move |req| {
- show_metrics(req, ctx.clone(), sfx.clone())
- }))
- }
- });
- let server = Server::bind(&socket_addr);
- let res = server.serve(make_svc);
- let (tx, rx) = tokio::sync::oneshot::channel::<()>();
- let graceful = res.with_graceful_shutdown(async {
- rx.await.ok();
- });
-
- if let Err(e) = graceful.await {
- error!("server error: {}", e);
+ tokio::spawn(async move {
+ let svc = service_fn(move |req| { show_metrics(req, ctx.clone(),
sfx.clone()) });
+ if let Err(e) = Builder::new()
+ .serve_connection(io, svc).await {
+ error!("server error: {}", e);
+ }
+ });
}
- let _ = tx.send(());
}
/// Adds lines related to a metric in the body (String) of response.
@@ -151,11 +150,11 @@
}
/// Handles requests and returns data formated for Prometheus.
-async fn show_metrics(
- req: Request<Body>,
+async fn show_metrics<B>(
+ req: Request<B>,
context: Arc<PowerMetrics>,
suffix: String,
-) -> Result<Response<Body>, Infallible> {
+) -> Result<Response<String>, Infallible> {
trace!("{}", req.uri());
let mut body = String::new();
if req.uri().path() == format!("/{}", &suffix) {
@@ -232,7 +231,7 @@
} else {
let _ = write!(body, "<a href=\"https://github.com/hubblo-org/scaphandre/\">Scaphandre's</a>
prometheus exporter here. Metrics available on <a href=\"/{suffix}\">/{suffix}</a>");
}
- Ok(Response::new(body.into()))
+ Ok(Response::new(body))
}
// Copyright 2020 The scaphandre authors.
--
,Sdrager
Blair Noctis
OpenPGP_signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Source: scaphandre
Source-Version: 1.0.2-5
Done: Jonas Smedegaard <[email protected]>
We believe that the bug you reported is fixed in the latest version of
scaphandre, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jonas Smedegaard <[email protected]> (supplier of updated scaphandre package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Tue, 22 Jul 2025 13:47:29 +0200
Source: scaphandre
Architecture: source
Version: 1.0.2-5
Distribution: experimental
Urgency: medium
Maintainer: Jonas Smedegaard <[email protected]>
Changed-By: Jonas Smedegaard <[email protected]>
Closes: 1109542
Changes:
scaphandre (1.0.2-5) experimental; urgency=medium
.
* add patch 1001_hyper to use newer crate hyper;
tighten build-dependencies for crates hyper hyper-util;
closes: bug#1109542, thanks to Blair Noctis
Checksums-Sha1:
6628d93db95c620c34669dc65ea6f1f307bb1189 3311 scaphandre_1.0.2-5.dsc
2cec73d3a48d461a0fa24cbb57fbe256b7fd6a26 12268 scaphandre_1.0.2-5.debian.tar.xz
3c061fe209433a5b96dbe2bfc3226ff0c810142b 20205
scaphandre_1.0.2-5_amd64.buildinfo
Checksums-Sha256:
c95ced2e0f25d45817ce86646fc261b60aadc9025e56143a469d3a69a4ae923f 3311
scaphandre_1.0.2-5.dsc
e8b3659ac140649e6de09478f2d6e1c3ceff2e3d5efe67e424907e95ae321571 12268
scaphandre_1.0.2-5.debian.tar.xz
2f2fd9625bddf2383d7d3ca364bf1486ffd6194d8fecb370e5e674dacad100ae 20205
scaphandre_1.0.2-5_amd64.buildinfo
Files:
bfdeed50d256bc2bd097a9c1f0fd5b99 3311 utils optional scaphandre_1.0.2-5.dsc
c4955852bf485159547cf3c8aadea9ec 12268 utils optional
scaphandre_1.0.2-5.debian.tar.xz
44a62ebca7ab3d21bd2ba658b0eeb279 20205 utils optional
scaphandre_1.0.2-5_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
wsG7BAEBCgBvBYJof3yiCRAsfDFGwaABIUcUAAAAAAAeACBzYWx0QG5vdGF0aW9u
cy5zZXF1b2lhLXBncC5vcmdnVGOWTVX1eqZoVwwrMo+4b2MCgI8KEimcD3Zde+Pv
gRYhBJ/j6cNmkaaf9TzGhCx8MUbBoAEhAAAE9w/+Ne6mm0DGO/if7vFb6/1jvf+f
joUcm7WKHMbcMosTdwLf8NAeAbI5D2fZf1v3HA6Klj5IfldOUdxEHbFqPwywMbWr
862DmWntadPRQrGgR9IQylPsJym5W+O/fczmR1+UEAguzjBtYoj6y8n2wV3K/JJY
9ACwnYVC8ucsoo3jo2CXSiNvGUW0N2Lm96MpHMxo3zDgZASi8lcUXk23Tuu1QS45
lH9neGiKubHUDtbEqCmW1eQhkO434oz8S7cBNUa42BB9jbalBD1ITr9EZZGBim38
co31GxKQ6BPn2YGMEpLOSiC94URauZ5SEUaDdqrborktPDz23x2KKnFKbDomYo/L
bgS6fLo9WrS/olFHtuqCp1VJVde5FhBn+6Wtj97rs+CP3E3lnEojLpw51JEwZ6UZ
z+la1GhQZ4FDZM+WEg0ToiKj17/G2vXNRZ5zPvBjEjSILAnjcuPBh0171EGO/5tx
lnT6lcHcvlchmCzWwVwb8KI7dzF2zKf+bDeiQuMloO1xmyF+t5v6B7gdEa+Nx8eP
HC1ar31uriZKtEffmxyh51o89U+WWB87MgVMGOBUtkhssn/clLX9WgeFMVhwP7Sy
MorXux3byydqvZJ4qWkQdfHSe1TyUUeCvEpdH/z16+SKjqUaH/P2lQ+wfy3duhOZ
Y8mu3Zj/y1PXXLoeKZk=
=ZZF1
-----END PGP SIGNATURE-----
pgpf0t9dw3WhM.pgp
Description: PGP signature
--- End Message ---