Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Mar 9, 2025

Fixes #475

Motivation

There were some breaking changes with Boost.Asio APIs so that the code base is incompatible with the latest Boost.Asio.

Modifications

  • Upgrade the Asio and Boost.Asio dependencies
  • Support verifying build with Boost.Asio (non-default) in CI, whose version (1.88) has deprecated some APIs
  • Replace deprecated (removed) APIs with the recommended new Asio APIs, including
    • Replace iterator based async_connect method with the async_connect function that accepts the list of endpoints from the latest async_resolve method. This also simplifies the code that it no longer needs to manually retry each endpoint, which might fix the issue like [Bug] C++ client cannot switch IPs when serviceUrl is a domain name with multiple resolved IPs #502
    • Replace io_service with io_context
    • Replace io_service::work with make_work_guard
    • Replace expires_from_now with expires_after for steady_timer, a wrapped cancelTimer function is used to simplify the try-catch clause
    • Replace rfc2818_verification with host_name_verification
  • Remove BOOST_VERSION conditional compilation, which makes code hard to maintain due to the Asio API compatibility changes.

@BewareMyPower BewareMyPower self-assigned this Mar 9, 2025
@BewareMyPower BewareMyPower added this to the 3.8.0 milestone Mar 9, 2025
@BewareMyPower BewareMyPower marked this pull request as draft March 9, 2025 14:53
oversearch added a commit to oversearch/pulsar-client-cpp that referenced this pull request Apr 9, 2025
This was introduced in v3.7.0 via apache#477. which contained a change that attempted to fix an issue where a pre-mature ack of a message before a multi-topic subscriber was ready could have caused a crash.  To fix the original bug, all multi-topic subscriptions are started with their message listener paused. They later get un-paused once all topics are successfully subscribed and connected.  However, on a regex subscription when new topics are discovered, they also start in a paused state, and there's no mechanism to resume them.  Hence, they get stuck, and no messages for new topics will be processed.

This change adds a call to resume any new listeners after new topics are added.  The fix has been deployed to production in my company's infrastructure and has been confirmed working for a few weeks.
carlocab added a commit to Homebrew/formula-patches that referenced this pull request Aug 5, 2025
@BewareMyPower BewareMyPower marked this pull request as ready for review October 3, 2025 15:00
@BewareMyPower BewareMyPower changed the title Adapt to latest Asio APIs (Asio 1.32 or Boost.Asio 1.87) Adapt to latest Asio APIs (Asio 1.32 or Boost.Asio 1.88) Oct 3, 2025
@BewareMyPower BewareMyPower merged commit f2f9f65 into apache:main Oct 4, 2025
14 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/boost-compatibility branch October 4, 2025 05:01
BewareMyPower added a commit that referenced this pull request Oct 13, 2025
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.

[Bug] Build breaks with boost-libs-1.87.0: fatal error: 'boost/asio/io_service.hpp' file not found

2 participants