Skip to content

Conversation

@zerodefect
Copy link
Contributor

This commit replaces boost::asio::deadline_timer with boost::asio::steady_timer.

The previous implementation relied on the system wall clock (boost::posix_time). This caused issues where heartbeat timers could hang or fire incorrectly if the system time was adjusted (e.g., via NTP or Daylight Savings).

The new implementation uses std::chrono::steady_clock (monotonic), ensuring timers fire at consistent intervals regardless of system time changes.

This commit replaces `boost::asio::deadline_timer` with `boost::asio::steady_timer`.

The previous implementation relied on the system wall clock (`boost::posix_time`).
This caused issues where heartbeat timers could hang or fire incorrectly if the
system time was adjusted (e.g., via NTP or Daylight Savings).

The new implementation uses `std::chrono::steady_clock` (monotonic), ensuring
timers fire at consistent intervals regardless of system time changes.
@zerodefect
Copy link
Contributor Author

PR #551 should be merged before this one. PR 551 may necessitate conflict resolution thereafter.

@zerodefect zerodefect changed the title Refactor: Replace deadline_timer with steady_timer Refactor: Replace LibBoostAsioHandler deadline_timer with steady_timer Dec 8, 2025
@paolopas
Copy link

paolopas commented Dec 8, 2025

I probably didn't understand how you intend to proceed, if we both try to factorize #550 we will probably waste a lot of time.
See #553 and your previous comment #550 (comment)

@zerodefect
Copy link
Contributor Author

I feel your changes are too ambitious - too many changes at once.

If one needs to do a git bisect, it becomes difficult to nail down a problem if too many things are globbed.

@zerodefect zerodefect changed the title Refactor: Replace LibBoostAsioHandler deadline_timer with steady_timer Refactor: Replace LibBoostAsioHandler deadline_timer with steady_timer (pt 2) Dec 8, 2025
@zerodefect
Copy link
Contributor Author

For those interested, I've created a new repository which encapsulates an improved/updated implementation of LibBoostAsioHandler (aka LibBoostAsioHandler2).

https://github.com/coralbay-tv/amqp-cpp-boost2

PRs welcome :)

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.

2 participants