Bug#1129856: saunafs: FTBFS with boost 1.90
> Dear maintainer:
Not sure why I wasn't notified, only found about this today. I guess I
need to subscribe to the HPC list?
>
> During a rebuild of all packages in unstable, this package failed to build.
>
> Below you will find the last part of the build log (probably the most
> relevant part, but not necessarily). If required, the full build log
> is available here:
>
> https://people.debian.org/~sanvila/build-logs/202603/
>
This is fixed in the latest release candidate of SaunaFS, but is not yet
officially released (next week should be the release). In the meantime,
I have a patch that's already in upstream.
I've included it as an attachment, but I'm not yet sure how to package
this properly for 5.1.2-1 that is in the repositories. Do I submit a
debdiff for this?
---
Best regards,
Urmas Rist
Description: Fix compilation for boost1.9
Author: Urmas Rist <urmas@urist.ee>
Forwarded: https://github.com/leil-io/saunafs/pull/754
Last-Update: 2026-02-18
---
--- a/cmake/Libraries.cmake
+++ b/cmake/Libraries.cmake
@@ -69,7 +69,7 @@
endif()
# Find Boost
-find_package(Boost CONFIG REQUIRED COMPONENTS filesystem iostreams program_options system)
+find_package(Boost CONFIG REQUIRED COMPONENTS filesystem iostreams program_options)
# Find Thrift
find_package(Thrift COMPONENTS library)
--- a/src/chunkserver/chunkserver-common/hdd_utils.h
+++ b/src/chunkserver/chunkserver-common/hdd_utils.h
@@ -20,6 +20,7 @@
#include "common/platform.h"
+#include <boost/shared_ptr.hpp>
#include <deque>
#include "chunkserver-common/chunk_interface.h"
--- a/src/chunkserver/chunkserver-common/plugin_manager.h
+++ b/src/chunkserver/chunkserver-common/plugin_manager.h
@@ -25,6 +25,7 @@
#include <boost/dll/import.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
+#include <boost/shared_ptr.hpp>
#include "chunkserver-common/disk_plugin.h"
--- a/src/uraft/uraft.cc
+++ b/src/uraft/uraft.cc
@@ -127,20 +127,20 @@
void uRaft::startElectionTimer() {
int timeout = opt_.election_timeout_min +
rand() % (opt_.election_timeout_max - opt_.election_timeout_min);
- election_timer_.expires_from_now(boost::posix_time::millisec(timeout));
+ election_timer_.expires_after(std::chrono::milliseconds(timeout));
election_timer_.async_wait(boost::bind(&uRaft::electionTimeout, this,
boost::asio::placeholders::error));
}
void uRaft::startHearbeatTimer() {
- heartbeat_timer_.expires_from_now(boost::posix_time::millisec(opt_.heartbeat_period));
+ heartbeat_timer_.expires_after(std::chrono::milliseconds(opt_.heartbeat_period));
heartbeat_timer_.async_wait(boost::bind(&uRaft::heartbeat, this,
boost::asio::placeholders::error));
}
void uRaft::signLoyaltyAgreement() {
state_.loyalty_agreement = true;
- loyalty_agreement_timer_.expires_from_now(boost::posix_time::millisec(opt_.election_timeout_min));
+ loyalty_agreement_timer_.expires_after(std::chrono::milliseconds(opt_.election_timeout_min));
loyalty_agreement_timer_.async_wait([this](const boost::system::error_code & error) {
if (!error) {
state_.loyalty_agreement = false;
--- a/src/uraft/uraft.h
+++ b/src/uraft/uraft.h
@@ -4,6 +4,7 @@
#include <boost/array.hpp>
#include <boost/asio.hpp>
+#include <boost/asio/steady_timer.hpp>
/*! \brief Implementation of modified Raft consensus algorithm.
*
@@ -162,8 +163,8 @@
protected:
boost::asio::io_context &io_service_;
boost::asio::ip::udp::socket socket_;
- boost::asio::deadline_timer election_timer_,heartbeat_timer_;
- boost::asio::deadline_timer loyalty_agreement_timer_;
+ boost::asio::steady_timer election_timer_,heartbeat_timer_;
+ boost::asio::steady_timer loyalty_agreement_timer_;
boost::array<uint8_t,kMaxPacketLength> packet_data_;
boost::asio::ip::udp::endpoint sender_endpoint_;
--- a/src/uraft/uraftcontroller.cc
+++ b/src/uraft/uraftcontroller.cc
@@ -17,6 +17,7 @@
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/version.hpp>
+#include <boost/chrono.hpp>
uRaftController::uRaftController(boost::asio::io_context &ios)
: uRaftStatus(ios),
@@ -48,11 +49,11 @@
return;
}
- check_cmd_status_timer_.expires_from_now(boost::posix_time::millisec(opt_.check_cmd_status_period));
+ check_cmd_status_timer_.expires_after(std::chrono::milliseconds(opt_.check_cmd_status_period));
check_cmd_status_timer_.async_wait(boost::bind(&uRaftController::checkCommandStatus, this,
boost::asio::placeholders::error));
- check_node_status_timer_.expires_from_now(boost::posix_time::millisec(opt_.check_node_status_period));
+ check_node_status_timer_.expires_after(std::chrono::milliseconds(opt_.check_node_status_period));
check_node_status_timer_.async_wait(boost::bind(&uRaftController::checkNodeStatus, this,
boost::asio::placeholders::error));
@@ -179,7 +180,7 @@
}
}
- check_cmd_status_timer_.expires_from_now(boost::posix_time::millisec(opt_.check_cmd_status_period));
+ check_cmd_status_timer_.expires_after(std::chrono::milliseconds(opt_.check_cmd_status_period));
check_cmd_status_timer_.async_wait(boost::bind(&uRaftController::checkCommandStatus, this,
boost::asio::placeholders::error));
}
@@ -221,13 +222,13 @@
}
}
- check_node_status_timer_.expires_from_now(boost::posix_time::millisec(opt_.check_node_status_period));
+ check_node_status_timer_.expires_after(std::chrono::milliseconds(opt_.check_node_status_period));
check_node_status_timer_.async_wait(boost::bind(&uRaftController::checkNodeStatus, this,
boost::asio::placeholders::error));
}
void uRaftController::setSlowCommandTimeout(int timeout) {
- cmd_timeout_timer_.expires_from_now(boost::posix_time::millisec(timeout));
+ cmd_timeout_timer_.expires_after(std::chrono::milliseconds(timeout));
cmd_timeout_timer_.async_wait([this](const boost::system::error_code & error) {
if (!error) {
syslog(LOG_ERR, "Metadata server mode switching timeout");
--- a/src/uraft/uraftcontroller.h
+++ b/src/uraft/uraftcontroller.h
@@ -75,9 +75,8 @@
void startFloatingIpManager();
void stopFloatingIpManager();
-protected:
- boost::asio::deadline_timer check_cmd_status_timer_,check_node_status_timer_;
- boost::asio::deadline_timer cmd_timeout_timer_;
+ boost::asio::steady_timer check_cmd_status_timer_,check_node_status_timer_;
+ boost::asio::steady_timer cmd_timeout_timer_;
pid_t command_pid_;
int command_type_; /// Last run command type.
Timer command_timer_;
Reply to: