Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
17dc0a9
Rebase initial impl on develop
anarthal Oct 15, 2025
c405188
Use connection_state in the writer
anarthal Oct 15, 2025
18267e2
writer timeouts in actions
anarthal Oct 15, 2025
4f0ada4
Fix possible problems with no timeouts
anarthal Oct 15, 2025
3fd35fe
make action a variant
anarthal Oct 15, 2025
0edc958
Make timeout part of the read action
anarthal Oct 15, 2025
884799b
Initial test
anarthal Oct 16, 2025
60d957e
refactor
anarthal Oct 16, 2025
e2fd373
Fix reader tests
anarthal Oct 16, 2025
b06c554
test health checks disabled
anarthal Oct 16, 2025
80ddad9
test read timeout
anarthal Oct 16, 2025
d3da431
Fix comment
anarthal Oct 16, 2025
9435195
simplify writer
anarthal Oct 16, 2025
9ecbdb4
Make writer tests build
anarthal Oct 16, 2025
daa7903
stronger writer_action interface
anarthal Oct 16, 2025
03f470d
Make writer_action use offset
anarthal Oct 16, 2025
1d44ac4
Fix writer tests
anarthal Oct 16, 2025
235ac67
Fix a partial success problem
anarthal Oct 16, 2025
7df92f3
short writes test
anarthal Oct 16, 2025
0a79bf1
add const
anarthal Oct 16, 2025
1041496
rework writer 1
anarthal Oct 16, 2025
75d9df9
write_timeout error
anarthal Oct 16, 2025
9c5f965
rework logging
anarthal Oct 16, 2025
df7554d
write timeout test
anarthal Oct 16, 2025
678f0c2
ping success
anarthal Oct 16, 2025
87c4262
ping error
anarthal Oct 16, 2025
843ae9e
Docs
anarthal Oct 16, 2025
b9a44b8
Remove some health check disables in tests
anarthal Oct 16, 2025
5ddcdd5
health checks disabled
anarthal Oct 16, 2025
aaccbb4
Remove unnecessary ping_resp
anarthal Oct 17, 2025
e448731
Use cancel_at
anarthal Oct 17, 2025
b2c150d
include cleanup
anarthal Oct 17, 2025
2af5702
Move the write offset to the multiplexer
anarthal Oct 17, 2025
a8a7a6a
Fix multiplexer tests
anarthal Oct 17, 2025
65e729d
short writes test
anarthal Oct 17, 2025
a052493
Remove unused multiplexer::is_writing
anarthal Oct 17, 2025
e5ef3ff
Fix exec_fsm tests
anarthal Oct 17, 2025
b9ee182
Fix writer fsm tests
anarthal Oct 17, 2025
3c24417
Fix failing multiplexer tests
anarthal Oct 17, 2025
0028adf
Remove unused function
anarthal Oct 17, 2025
0a0d5a6
Missing includes
anarthal Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/cpp20_chat_room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <boost/asio/consign.hpp>
#include <boost/asio/detached.hpp>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/read_until.hpp>
#include <boost/asio/redirect_error.hpp>
#include <boost/asio/signal_set.hpp>

Expand Down
1 change: 1 addition & 0 deletions example/cpp20_echo_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/consign.hpp>
#include <boost/asio/detached.hpp>
#include <boost/asio/read_until.hpp>
#include <boost/asio/redirect_error.hpp>
#include <boost/asio/signal_set.hpp>

Expand Down
21 changes: 19 additions & 2 deletions include/boost/redis/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct config {
*/
std::optional<int> database_index = 0;

/// Message used by the health-checker in @ref boost::redis::basic_connection::async_run.
/// Message used by `PING` commands sent by the health checker.
std::string health_check_id = "Boost.Redis";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sidenote: When the user does not provide one id, I think we should format this to contain the id returned by the HELLO command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What does it mean "does not provide one id" here? Leave health_check_id to the default? Make health_check_id empty?

The change is not trivial because it requires coordination between the setup task (which may not contain a HELLO at all) and the health checker.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean, if the user does not provide its own health_check_id the connection could set it to "Boost.Redis (conn-id)". At the moment we only set to "Boost.Redis".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'd need to detect whether the setup request contains a hello, and then parse the response and update the ping ID. Do you think it's worth it?


/**
Expand All @@ -105,7 +105,24 @@ struct config {
std::chrono::steady_clock::duration ssl_handshake_timeout = std::chrono::seconds{10};

/** @brief Time span between successive health checks.
* Set to zero to disable health-checks pass zero as duration.
* Set to zero to disable health-checks.
*
* When this value is set to a non-zero duration, @ref basic_connection::async_run
* will issue `PING` commands whenever no command is sent to the server for more
* than `health_check_interval`. You can configure the message passed to the `PING`
* command using @ref health_check_id.
*
* Enabling health checks also sets timeouts to individual network
* operations. The connection is considered dead if:
*
* @li No byte can be written to the server after `health_check_interval`.
* @li No byte is read from the server after `2 * health_check_interval`.
*
* If the health checker finds that the connection is unresponsive, it will be closed,
* and a reconnection will be triggered, as if a network error had occurred.
*
* The exact timeout values are *not* part of the interface, and might change
* in future versions.
*/
std::chrono::steady_clock::duration health_check_interval = std::chrono::seconds{2};

Expand Down
Loading