Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection pool #188

Closed
wants to merge 240 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
a623f10
any_connection prototype
anarthal Oct 30, 2023
9f7e935
varriant_stream to impl file
anarthal Oct 30, 2023
4953aea
Merge branch 'develop' into feature/19-connection-pool-2
anarthal Nov 2, 2023
891bba1
First implementation
anarthal Nov 3, 2023
2021d58
Minor fixes
anarthal Nov 3, 2023
f1e77f4
any_address
anarthal Nov 3, 2023
0ef2954
Header only impl
anarthal Nov 3, 2023
7440560
Unix macro name fix
anarthal Nov 3, 2023
0ede222
Moved some fns to .ipp
anarthal Nov 3, 2023
5f534fe
misc api fixes
anarthal Nov 4, 2023
82524d1
any_connection::connect now clears all state
anarthal Nov 4, 2023
228bbfc
Fixes in variant_stream
anarthal Nov 4, 2023
8623279
connect_params, WIP
anarthal Nov 6, 2023
91767a6
owning_connect_params wip
anarthal Nov 6, 2023
f9cc337
New owning connect params
anarthal Nov 7, 2023
7a7cf9a
sync_errc spotchecks for any_connection
anarthal Nov 7, 2023
5980211
Spotchecks for other variants
anarthal Nov 7, 2023
6ac9c0f
Removed explicit dependency from concrete streams
anarthal Nov 7, 2023
874d8be
Made variant_stream internal
anarthal Nov 7, 2023
248ee59
split ssl_context_with_default
anarthal Nov 7, 2023
6569d0a
reconnect tests 1
anarthal Nov 8, 2023
5ef90f2
Reconnect tests (1)
anarthal Nov 8, 2023
e69e3cd
reconnect tests (2)
anarthal Nov 8, 2023
074fd82
run_stackful_coro
anarthal Nov 8, 2023
3be02e7
final connect_params API
anarthal Nov 8, 2023
dced355
pool_params
anarthal Nov 8, 2023
0febc5c
General fixes & integ test
anarthal Nov 8, 2023
d8e7a8c
Increased pool test cov
anarthal Nov 8, 2023
bf52182
fixed get_connection timeout handling
anarthal Nov 8, 2023
3e80799
Finished connection_pool integ tests
anarthal Nov 8, 2023
933f6e0
Added tests to jamfiles
anarthal Nov 8, 2023
efb8866
Unified config structs
anarthal Nov 9, 2023
874163b
Removed connection_base
anarthal Nov 9, 2023
f2fc34c
default_port in any_address
anarthal Nov 9, 2023
380d19d
Ctor from execution context
anarthal Nov 9, 2023
0c4def6
any_connection example
anarthal Nov 9, 2023
b5700e0
pool ctor from execution context
anarthal Nov 9, 2023
21392ae
Removed collation from pool params
anarthal Nov 9, 2023
1b11e18
Base benchmark
anarthal Nov 13, 2023
dea7395
Fixed race condition when posting
anarthal Nov 13, 2023
596eefb
Refactored connection_pool bench
anarthal Nov 13, 2023
237dacf
Final benchmark code
anarthal Nov 13, 2023
a665bce
Final any_address API
anarthal Nov 13, 2023
928fc04
connect_params docs and fixes
anarthal Nov 14, 2023
84bb699
any_connection docs
anarthal Nov 14, 2023
72edee3
pool_params final API and docs
anarthal Nov 14, 2023
2a835c4
pooled_connection docs and final API
anarthal Nov 15, 2023
de59b24
connection_pool docs 1
anarthal Nov 15, 2023
80dc618
Finished connection_pool reference
anarthal Nov 15, 2023
d18deee
thread-safety tests 1
anarthal Nov 15, 2023
1201126
New thread-safety mechanism
anarthal Nov 16, 2023
133c369
Documented the new mechanism
anarthal Nov 16, 2023
9ae3f54
quickref
anarthal Nov 16, 2023
44784c7
any_connection discussion & snippets
anarthal Nov 16, 2023
cc44697
assertions on snippets
anarthal Nov 17, 2023
6ba5e98
connection_pool HTTP server example
anarthal Nov 18, 2023
30ac371
File cleanup
anarthal Nov 18, 2023
545e4c6
Connection pool discussion (1)
anarthal Nov 18, 2023
55edb47
Example bugfix
anarthal Nov 28, 2023
19e59bd
Example lifetime fixes
anarthal Nov 28, 2023
e6650f0
MySQL example notes
anarthal Nov 28, 2023
7f93a11
types docs
anarthal Nov 28, 2023
01c74a2
server refactor
anarthal Nov 28, 2023
895d7c4
New namespace
anarthal Nov 28, 2023
81a4ff7
server docs and fixes
anarthal Nov 28, 2023
7a7e360
rebalanced quickref
anarthal Nov 28, 2023
b9f8e6d
Added examples to quickbooks
anarthal Nov 28, 2023
3405ef5
Fixed num columns
anarthal Nov 28, 2023
2c51453
Discussion get_connection, pool sizes
anarthal Nov 29, 2023
3a0213a
Explanation on session state
anarthal Nov 29, 2023
583e0f2
Connection lifecycle
anarthal Nov 29, 2023
c45f9d9
run_with_timeout
anarthal Nov 29, 2023
da98def
client_errc::cancelled & simplification
anarthal Nov 29, 2023
c31e29a
optional timeouts
anarthal Nov 29, 2023
d354475
Discussion on thread-safety
anarthal Nov 30, 2023
4ce448f
Made the example thread-safe
anarthal Nov 30, 2023
88f7041
Transport types section
anarthal Nov 30, 2023
0ee87ac
sync snippet
anarthal Nov 30, 2023
4e5b02a
Improved benchmark result generation
anarthal Nov 30, 2023
2e335e8
Benchmak section
anarthal Nov 30, 2023
abb0f9e
qbk reorder
anarthal Nov 30, 2023
a180ec0
enhanced experimental notices
anarthal Nov 30, 2023
0c987eb
Basic fixes
anarthal Nov 30, 2023
75f5ea7
any_connection fixes
anarthal Nov 30, 2023
569d921
connection_pool fixes
anarthal Nov 30, 2023
a31a73b
doxygen initial fixes
anarthal Nov 30, 2023
c546ac5
Doxygen fixes
anarthal Dec 1, 2023
8a31b43
Reduced thread_safety test length
anarthal Dec 1, 2023
a56ae07
Proper runner for the connection_pool tests
anarthal Dec 1, 2023
42bc3c6
Added connection_pool example run to cmake
anarthal Dec 1, 2023
46b3241
B2 example
anarthal Dec 1, 2023
8f2fb4c
Solved race condition with connection_pool example in CI
anarthal Dec 1, 2023
e104627
Updated built libs in ci.py
anarthal Dec 1, 2023
390f32a
Removed unused comment
anarthal Dec 1, 2023
30e31c5
old cpp fixes (1)
anarthal Dec 4, 2023
378fa37
integ tests c++14 fixes
anarthal Dec 4, 2023
6a43eeb
C++11 support for deferred
anarthal Dec 4, 2023
5080414
Remaining C++11 fixes
anarthal Dec 4, 2023
2d836ca
requests for CIs
anarthal Dec 4, 2023
26a0235
Fixed snippets test
anarthal Dec 4, 2023
d89305a
requests to dockerfiles
anarthal Dec 4, 2023
d34a92a
requests via apt
anarthal Dec 4, 2023
c9863ec
Update container tags
anarthal Dec 4, 2023
9b91f75
Idle typos
anarthal Dec 4, 2023
ad6110d
Discussion typo fix
anarthal Dec 4, 2023
01eecfc
Assign executor params in ctor
anarthal Dec 4, 2023
0945f2a
Removed unused todo comment
anarthal Dec 5, 2023
67e17e2
C++11 guard for connection pool example runner
anarthal Dec 5, 2023
f6cfa44
Added thread-safety test to CI
anarthal Dec 5, 2023
cb444c8
commented unreliable test
anarthal Dec 5, 2023
c4711ca
Added any_connection example to Jamfile
anarthal Dec 5, 2023
a1403fe
Major refactor
anarthal Dec 5, 2023
7ba1dd5
sansio_connection_node tests (1)
anarthal Dec 5, 2023
c9b2a06
Fixed problem on collection
anarthal Dec 5, 2023
1e31760
state machine refactor
anarthal Dec 5, 2023
52e3bbb
Further state machine tests
anarthal Dec 6, 2023
33dcdd8
Refactor sansio node cancellations
anarthal Dec 6, 2023
7aa98f2
Moved channel outside idle_conection_list
anarthal Dec 6, 2023
4c50544
New intrusive list
anarthal Dec 6, 2023
f8e031b
split connection_node I/O ops
anarthal Dec 6, 2023
154fca9
connection_node_tests wip
anarthal Dec 6, 2023
20a9591
connection_node first test
anarthal Dec 6, 2023
258f3ea
erasing for connection_pool
anarthal Dec 7, 2023
041616c
Fixed snippets
anarthal Dec 7, 2023
e8b4367
Request waiting now uses plain timers
anarthal Dec 7, 2023
3db624b
with timeout and diag test
anarthal Dec 7, 2023
d73fc65
Simplified run_with_timeout
anarthal Dec 7, 2023
53a8d68
refactor connection_node tests
anarthal Dec 7, 2023
35faa2a
Race condition fixing
anarthal Dec 11, 2023
892eb24
Updated thread-safety test
anarthal Dec 11, 2023
c0b9ba4
msvc 14.1 workaround
anarthal Dec 11, 2023
2bfff32
Refactor connection_pool_impl tests
anarthal Dec 11, 2023
e8244e0
Added 2 lifecycle tests
anarthal Dec 11, 2023
9b2f38a
ping lifecycle tests
anarthal Dec 11, 2023
7637fd9
return without reset lifecycle test
anarthal Dec 11, 2023
5df8f6c
explicit return type to op_impl in tests
anarthal Dec 11, 2023
97362d7
hostname to thread-safety tests
anarthal Dec 11, 2023
a52c51e
tsan suppressions
anarthal Dec 11, 2023
4b7fe02
Revamped lifecycle tests
anarthal Dec 11, 2023
b1ef6d2
Disabled timeouts tests
anarthal Dec 11, 2023
96564b7
pool limit testing
anarthal Dec 11, 2023
1363cf4
Multi request test
anarthal Dec 11, 2023
2173081
cancel unit tests
anarthal Dec 11, 2023
48467bd
custom ssl ctx and buffer size tests
anarthal Dec 11, 2023
4938826
zero timeouts spotcheck
anarthal Dec 11, 2023
d0e1417
connect_params check
anarthal Dec 11, 2023
f81509b
Removed pooled_connection header
anarthal Dec 11, 2023
73eef12
Moved headers to reflect actual erasing structure
anarthal Dec 11, 2023
073f8c6
timer_list tests
anarthal Dec 12, 2023
04036f3
timer_list test refactor
anarthal Dec 12, 2023
afcfa30
pool_params validation tests & bugfix
anarthal Dec 12, 2023
58bbf38
Simplified SSL context management
anarthal Dec 12, 2023
f1fb484
Fixed race condition with parallel_groups
anarthal Dec 13, 2023
4d9e199
Improved in-code docs
anarthal Dec 13, 2023
683f3b4
Added thread-safety check on async_run
anarthal Dec 13, 2023
8b1f80c
wait_group tests
anarthal Dec 13, 2023
5b626e0
Refactored wait_group tests
anarthal Dec 13, 2023
87c6378
get_connection timeout spotcheck
anarthal Dec 13, 2023
9531ac3
misc CI fixes
anarthal Dec 13, 2023
8acc14e
Fixed reconnection tests on non-UNIX systems
anarthal Dec 13, 2023
b51f8f0
attempt to suppress osx tsan warning
anarthal Dec 13, 2023
a67ac6d
workaround for clang 3.6 bug
anarthal Dec 13, 2023
06ece0e
Missing connect_params.hpp include
anarthal Dec 13, 2023
3e657cc
disable tsan for arm
anarthal Dec 13, 2023
2d31efe
All context libs are now built without warnings
anarthal Dec 13, 2023
a158d41
explicit shared_from_this
anarthal Dec 13, 2023
a49c185
cstdint missing header in coldef_view
anarthal Dec 13, 2023
d3053fc
pool ctors & assignment tests
anarthal Dec 13, 2023
350fd75
pool executor tests
anarthal Dec 13, 2023
29dadd4
pooled_connection unit tests
anarthal Dec 14, 2023
caa9976
pool lifetime extension tests
anarthal Dec 14, 2023
48952ee
any_addess tests & simplification
anarthal Dec 14, 2023
13ac12d
pool_executor_params tests
anarthal Dec 14, 2023
db42ed0
Not running error code & tests
anarthal Dec 14, 2023
067092a
test fix
anarthal Dec 14, 2023
bb92aec
Added diagnostics checks in connection_pool
anarthal Dec 14, 2023
bf9d7b9
async_get_connection overload tests
anarthal Dec 14, 2023
b1f8fc9
C++11 deferred checks
anarthal Dec 14, 2023
03bdf7c
C++11 fixes
anarthal Dec 14, 2023
ab4d427
suppress gcc13 spurious warning
anarthal Dec 14, 2023
c44b74f
gcc13 tsan warning suppression
anarthal Dec 14, 2023
fa2319f
Disable tsan for osx
anarthal Dec 14, 2023
26a9784
C++14 fix
anarthal Dec 14, 2023
2c1090f
Removed unit tests from valgrind
anarthal Dec 14, 2023
a33a22b
attempt to correct tsan exclusion for osx
anarthal Dec 14, 2023
3bdbdd3
remove coroutines from unit tests (1)
anarthal Dec 15, 2023
66b7852
fix pool tsts (2)
anarthal Dec 15, 2023
8712674
pool tests (3)
anarthal Dec 15, 2023
3cdd7ca
pool tests (4)
anarthal Dec 15, 2023
f770c33
pool tests (5)
anarthal Dec 15, 2023
1e84f9a
pool tests (6)
anarthal Dec 15, 2023
48d0971
pool tests (8)
anarthal Dec 15, 2023
66cb9c6
pool tests (9)
anarthal Dec 15, 2023
871d383
Finished pool tests
anarthal Dec 15, 2023
e123466
docs & refactor for conn pool tests
anarthal Dec 15, 2023
a632793
Recovered valgrind for unit tests
anarthal Dec 15, 2023
87a9dfa
Remove gcc-13 from tsan
anarthal Dec 15, 2023
099ef8c
Simplified detached_get_connection
anarthal Dec 15, 2023
c7a83dd
Corrected gcc-13 tsan exclusion
anarthal Dec 15, 2023
d0351b7
small connection_pool tests refactor
anarthal Dec 15, 2023
a65bd8e
fixed asan issue in tests
anarthal Dec 15, 2023
60e0928
Removed Boost.Context linking from unit tests
anarthal Dec 15, 2023
3f075e5
Updated container sha from build_unix_local
anarthal Dec 15, 2023
297c939
Fixed process termination in win
anarthal Dec 18, 2023
7b0bfdc
Fixed potential slow name resolution
anarthal Dec 18, 2023
240bf34
Fixed incorrect flags in gcc-13 Jamfile
anarthal Dec 18, 2023
7f29436
pool's dtor no longer cancels
anarthal Dec 18, 2023
58c37bf
proper work guard in wait_group unit tests
anarthal Dec 18, 2023
1a92928
Removed unreliable timer_list test
anarthal Dec 18, 2023
2f648fa
Fixed deadlock in integ tests
anarthal Dec 18, 2023
d0b1f2e
Fix server termination in example
anarthal Dec 18, 2023
ee38d54
Fixed unreliable check in snippets
anarthal Dec 18, 2023
fcc3c0e
Split functionality from server.cpp
anarthal Dec 18, 2023
0bf8b4d
msvc 14.1 exclusion
anarthal Dec 19, 2023
79b8a9c
Fixed conditional property syntax
anarthal Dec 19, 2023
f1075cc
connect_params_helpers tests
anarthal Dec 19, 2023
f51cdbc
any_connection unit tests
anarthal Dec 19, 2023
7bf7d8f
any_connection integ tests (1)
anarthal Dec 19, 2023
dd92645
any_connection integ tests (2)
anarthal Dec 19, 2023
7b83665
Failing UNIX+caching_sha2p_password tst
anarthal Dec 19, 2023
f865fea
async_connect lifetime tests
anarthal Dec 19, 2023
73b9b5e
any_connection extra spotcheck
anarthal Dec 19, 2023
466ec8a
deferred C++11 fixes
anarthal Dec 20, 2023
de652c0
Removed post_until
anarthal Dec 20, 2023
2ef9303
initial_size 0 test
anarthal Dec 20, 2023
bc25653
pool test refactor (1)
anarthal Dec 20, 2023
3fe69ac
pool test refactor (2)
anarthal Dec 20, 2023
87d8391
pool tests refactor (3)
anarthal Dec 20, 2023
422aa88
Intrusive & optional cmake deps
anarthal Dec 20, 2023
8a2f047
missing example annotations
anarthal Dec 20, 2023
131f42b
example cerr sync
anarthal Dec 20, 2023
fefe457
cancel before run tests
anarthal Dec 20, 2023
b2f1373
Minor adjustments to variant_stream
anarthal Dec 20, 2023
7071bb0
docs fixes
anarthal Dec 20, 2023
6d9e280
discussion correction
anarthal Dec 20, 2023
277e41a
BOOST_ASIO_HAS_LOCAL_SOCKETS guards in variant_stream
anarthal Dec 20, 2023
7ca34f2
Missing decorator for sha256 test
anarthal Dec 20, 2023
3a64ed7
Exclusion for connection_pool example under asan
anarthal Dec 20, 2023
0c44c80
minmax protection
anarthal Dec 20, 2023
617b2b1
Removed max_connections setting from db_setup
anarthal Dec 20, 2023
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
3 changes: 3 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Diagnostics:
ClangTidy:
Remove: bugprone-unused-return-value
12 changes: 6 additions & 6 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#

_triggers = { "branch": [ "master", "develop", "drone*", "feature/*", "bugfix/*", "fix/*", "pr/*" ] }
_container_tag = '454e58d36a2e801a1a6b4e9fd2f995c3087740b1'
_win_container_tag = '454e58d36a2e801a1a6b4e9fd2f995c3087740b1'
_container_tag = 'd34a92a9b9702a0a5e2b9ab4a635f7b077229626'
_win_container_tag = 'd34a92a9b9702a0a5e2b9ab4a635f7b077229626'


def _image(name):
Expand All @@ -24,7 +24,7 @@ def _b2_command(
variant,
stdlib='native',
address_model='64',
server_host='localhost',
server_host='127.0.0.1',
separate_compilation=1,
address_sanitizer=0,
undefined_sanitizer=0
Expand Down Expand Up @@ -56,7 +56,7 @@ def _cmake_command(
install_tests=1,
generator='Ninja',
db='mysql8',
server_host='localhost'
server_host='127.0.0.1'
):
return 'python tools/ci.py ' + \
'--build-kind=cmake ' + \
Expand Down Expand Up @@ -175,7 +175,7 @@ def windows_b2(
cxxstd=cxxstd,
variant=variant,
address_model=address_model,
server_host='localhost'
server_host='127.0.0.1'
)
return _pipeline(name=name, image=image, os='windows', command=command, db=None)

Expand Down Expand Up @@ -218,7 +218,7 @@ def windows_cmake(
build_shared_libs=build_shared_libs,
generator='Visual Studio 17 2022',
db='mysql8',
server_host='localhost'
server_host='127.0.0.1'
)
return _pipeline(
name=name,
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: |
unlink /usr/local/bin/python
unlink /usr/local/bin/python || echo "/usr/local/bin/python not found"
ln -s /usr/local/bin/python3 /usr/local/bin/python
python -m pip install requests
source tools/setup_db_osx.sh
python tools/ci.py \
--build-kind=b2 \
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ add_library(Boost::mysql ALIAS boost_mysql)
# Dependencies
if (BOOST_MYSQL_IS_ROOT)
# If we're the root project, error if a dependency is not found
find_package(Boost ${BOOST_MYSQL_VERSION} REQUIRED COMPONENTS headers system)
find_package(Boost ${BOOST_MYSQL_VERSION} REQUIRED COMPONENTS headers)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
target_link_libraries(
boost_mysql
INTERFACE
Boost::headers
Boost::system
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
Expand Down Expand Up @@ -64,12 +63,14 @@ else()
Boost::config
Boost::core
Boost::describe
Boost::endian
Boost::intrusive
Boost::lexical_cast
Boost::mp11
Boost::optional
Boost::system
Boost::throw_exception
Boost::variant2
Boost::endian
Boost::lexical_cast
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
Expand Down Expand Up @@ -117,4 +118,8 @@ if(BUILD_TESTING)
add_subdirectory(example)
endif()

# We don't run benchmarks, but we build them to prevent code rotting
if (BOOST_MYSQL_IS_ROOT)
add_subdirectory(bench)
endif()
endif()
18 changes: 18 additions & 0 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright (c) 2019-2023 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#


add_executable(
boost_mysql_bench_connection_pool
connection_pool.cpp
)

target_link_libraries(
boost_mysql_bench_connection_pool
PUBLIC
boost_mysql_compiled
)
Loading