Skip to content

build: Fix compilation errors for boost 1.9#754

Merged
uristdwarf merged 1 commit intodevfrom
fix-boost19
Feb 19, 2026
Merged

build: Fix compilation errors for boost 1.9#754
uristdwarf merged 1 commit intodevfrom
fix-boost19

Conversation

@uristdwarf
Copy link
Collaborator

This also changes from posix_timer (which I think is system time) to steady_timer (monotonic time), which should help avoid bugs with system time.

@gemini-code-assist
Copy link

Summary of Changes

Hello @uristdwarf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on updating the project to be compatible with Boost 1.9, resolving compilation errors, and enhancing the robustness of timer mechanisms. The changes involve migrating Boost.Asio timers from system-time-based deadline_timer to monotonic-time-based steady_timer to prevent issues related to system clock changes. Additionally, CMake configurations and header inclusions have been adjusted to align with the new Boost version requirements.

Highlights

  • Boost 1.9 Compatibility: Updated CMake configuration to remove the system component from Boost package finding, addressing potential compilation issues with Boost 1.9.
  • Timer Implementation Update: Migrated Boost.Asio timer usage from boost::asio::deadline_timer and boost::posix_time::millisec to boost::asio::steady_timer and std::chrono::milliseconds for improved reliability.
  • Monotonic Time Usage: Switched timers to use monotonic time (steady_timer) instead of system time (posix_timer) to prevent bugs caused by system clock adjustments.
  • Header Adjustments: Added necessary Boost headers (boost/shared_ptr.hpp, boost/asio/steady_timer.hpp, boost/chrono.hpp) to support the updated Boost APIs.
Changelog
  • cmake/Libraries.cmake
    • Removed the system component from the Boost find_package call.
  • src/chunkserver/chunkserver-common/hdd_utils.h
    • Included boost/shared_ptr.hpp.
  • src/chunkserver/chunkserver-common/plugin_manager.h
    • Included boost/shared_ptr.hpp.
  • src/uraft/uraft.cc
    • Replaced expires_from_now(boost::posix_time::millisec(...)) with expires_after(std::chrono::milliseconds(...)) for election, heartbeat, and loyalty agreement timers.
  • src/uraft/uraft.h
    • Included boost/asio/steady_timer.hpp.
    • Changed boost::asio::deadline_timer to boost::asio::steady_timer for election, heartbeat, and loyalty agreement timers.
  • src/uraft/uraftcontroller.cc
    • Included boost/chrono.hpp.
    • Updated all timer expiration calls from expires_from_now with posix_time to expires_after with std::chrono.
  • src/uraft/uraftcontroller.h
    • Changed boost::asio::deadline_timer to boost::asio::steady_timer for all controller-managed timers.
Activity
  • No specific pull request activity (comments, reviews) was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses compilation errors with Boost 1.9 and updates timer implementations to use steady_timer instead of deadline_timer and expires_after with std::chrono::milliseconds instead of expires_from_now with boost::posix_time::millisec. This change improves the robustness of the timing mechanisms by switching from system time to monotonic time, which is less susceptible to system clock adjustments. Additionally, boost::shared_ptr.hpp and boost/chrono.hpp headers are included where needed, and the Boost system component is removed from find_package in cmake/Libraries.cmake as it's no longer explicitly required by the updated timer usage. All original comments have been retained as they are valid and do not contradict any provided rules.

Copy link
Contributor

@ralcolea ralcolea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @uristdwarf! 👍
I also tested the Molecule suite with this branch and all the tests passed successfully!

This also changes from posix_timer (which I think is system time) to
steady_timer (monotonic time), which should help avoid bugs with system
time.

Signed-off-by: Urmas Rist <urmas@leil.io>
@uristdwarf uristdwarf merged commit 238a9c8 into dev Feb 19, 2026
11 checks passed
@uristdwarf uristdwarf deleted the fix-boost19 branch February 20, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants