Skip to content

Commit

Permalink
Document that ping_interval should be >= wait_timeout
Browse files Browse the repository at this point in the history
Fix defect in connection_pool docs

close #290
  • Loading branch information
anarthal authored Oct 14, 2024
1 parent eba723f commit fe5b27d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/boost/mysql/connection_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class pooled_connection
* - Calling \ref connection_pool::async_run.
* - Calling \ref connection_pool::async_get_connection.
* - Cancelling \ref async_get_connection by emitting a cancellation signal.
* - \ref Returning a connection by destroying a \ref pooled_connection or
* - Returning a connection by destroying a \ref pooled_connection or
* calling \ref pooled_connection::return_without_reset.
* - Cancelling the pool by calling \ref connection_pool::cancel,
* emitting a cancellation signal for \ref async_run, or destroying the
Expand Down
11 changes: 8 additions & 3 deletions include/boost/mysql/pool_params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ struct pool_params
* `ping_interval`, a health-check will be performed (using \ref any_connection::async_ping).
* Pings will be sent with a periodicity of `ping_interval` until the connection
* is handed to the user, or a ping fails.
* \n
*
* Set this interval to zero to disable pings.
* \n
* This value must not be negative.
*
* This value must not be negative. It should be bigger than the server's
* idle timeout (as determined by the
* <a
* href="https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_wait_timeout">wait_timeout</a>
* session variable). Otherwise, the server might close connections
* without the pool detecting it.
*/
std::chrono::steady_clock::duration ping_interval{std::chrono::hours(1)};

Expand Down

0 comments on commit fe5b27d

Please sign in to comment.