Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f25594b
httpd: added listener index to http request
mmaslankaprv Apr 1, 2021
c39663b
http: enable specifying a content type on exceptions
jcsp Dec 9, 2021
ced4b17
http: don't jsonize exception if has content type
jcsp Dec 9, 2021
9430122
http: use base_exception content type in non-json errors
jcsp Dec 9, 2021
27b7fb2
metrics: allow multiple metrics::impl instances
Jun 1, 2022
0ee1486
metrics: expose metric impl handle to internal api
Jun 22, 2022
5d78395
metrics: expose handle in metric_groups_impl
Jul 18, 2022
e73a347
metrics: expose metric impl handle to external api
Jun 22, 2022
151823d
metrics: Use handle for impl object
Jun 22, 2022
aa90df4
prometheus: support multiple metric impls
Jun 1, 2022
3f737ea
scollectd: select internal metrics implementation
Jun 1, 2022
55dc12b
metrics: Expose 'skip_when_empty' for metrics
Jul 7, 2022
2179447
metrics: add helpers for creation of replicas
Jul 12, 2022
6fd85c4
metrics: allow for removal of replicated metrics
Jul 11, 2022
69a4762
metrics: add metric replication internal interface
Jul 12, 2022
f66547c
metrics: register replicated metrics dinamically
Jul 11, 2022
f70c6f8
metrics: public family replication interface
Jul 12, 2022
6db1233
tests: add metrics replication unit tests
Jul 11, 2022
ff56a83
metrics: Add update_aggregate_labels()
StephanDollberg Oct 19, 2023
a618fe8
scheduling_group: expose usage statistics
Aug 8, 2022
dea259b
http: rename http client logger
dotnwat Apr 18, 2023
328cbe9
Revert default backend to aio
travisdowns May 31, 2023
b2181bf
reactor: refactor timers out of stall_detector
ballard26 May 8, 2023
e33f233
tests/unit: refactor stall_detector test functions
ballard26 May 8, 2023
aaf35ae
core: cpu profiler implementation
ballard26 May 8, 2023
0987702
core/cpu_profiler: avoid taking samples during exception unwinding
ballard26 Aug 28, 2023
c4e6f1b
tests/cpu_profiler: add test to verify that `on_signal` doesn't allocate
ballard26 Aug 28, 2023
3b99c40
tests/cpu_profiler: add tests that ensure correct behavior during exc…
ballard26 Aug 30, 2023
e05aa93
core/cpu_profiler: finer-grain stats for why a sample was dropped
ballard26 Aug 28, 2023
ac338c7
Store original values from io-priorities yaml
Lazin Sep 25, 2023
e764792
core/cpu_profiler: add danger zone escape hatch
rockwotj Apr 4, 2024
2320864
tests: fix cpu_profiler unit tests
ballard26 Jan 10, 2025
240f4c6
cpu_profiler: include SG in sample
travisdowns Feb 18, 2025
088c171
cpu_profiler: test for scheduling groups
travisdowns Feb 18, 2025
7b82073
stall_detector: fix unused function warning/error
travisdowns Feb 20, 2025
647453e
cpu_profiler: deflake and various fixes
travisdowns Feb 19, 2025
9d0e9ae
core/internal: refactor signal_mutex into its own header/object
ballard26 May 20, 2025
b530d34
backtrace: guard libgcc's backtrace to avoid concurrent calls
ballard26 May 20, 2025
fb6b00a
backtrace: move guarded_backtrace, build fix
travisdowns Jul 11, 2025
0e6ca53
cpu_profiler_test: disable if backtrace unimplemented
travisdowns Jul 12, 2025
9c892a3
Revert "util/log: drop unused function"
Apr 25, 2024
e86a479
io_queue: add smp header to get full smp def
ballard26 Oct 2, 2024
b3860d4
treewide: specify ambiguous format calls
ballard26 Oct 2, 2024
c2f1804
treewide: explicitly ignore write/read results in specific areas
ballard26 Oct 3, 2024
2239581
core: make reference counting in deleter atomic
ballard26 Oct 15, 2024
dcbd987
core: make custom deleter constructor private
ballard26 Oct 31, 2024
a738bcf
memcached: use maybe_unsafe_from_deleter for temporary_buffer
travisdowns Mar 30, 2026
d4fb6b1
core: make `deleter::append` private
ballard26 Nov 5, 2024
46283c5
demos: Allow for setting additional key settings
michael-redpanda May 29, 2024
2b20c7b
http: add `to_reply()` in `httpd::redirect_exception`
WillemKauf Apr 18, 2024
7a0f97e
GHA: disable modules build
travisdowns Apr 14, 2025
a40f9b5
io-queue: Refactor cost function
StephanDollberg Jul 24, 2025
18d9cb7
io-queue: Use max cost function by default
StephanDollberg Jul 24, 2025
395399f
Add scoped to fallback to system alloc
travisdowns May 8, 2025
55566a5
GHA: disable dppk
travisdowns Oct 2, 2025
71b1a55
net: Permit exceptions out of remote and local address
michael-redpanda Oct 31, 2025
19e4787
aio_general_context: flush: return short flush on error
bhalevy Aug 15, 2023
2423df8
aio_general_context: flush: abort on unexpected errors
bhalevy Aug 15, 2023
f922a4b
aio_general_context: Allow more than max_poll() queued iocbs
StephanDollberg Nov 7, 2023
57c4b2a
http::request: remove content deprecation
travisdowns Dec 17, 2025
797d9e3
memory: reduce large allocation warning to debug level in scoped fall…
travisdowns Feb 5, 2026
bfb7a37
opt out of AI training per GitHub policy
rpdevmp Mar 10, 2026
e93d264
tls: add cert_info struct and certificate accessors
travisdowns Mar 31, 2026
bc35fd9
tls: add reload_callback_with_creds and get_trust_file_blob
travisdowns Mar 31, 2026
b17fd93
tls: add dn_format enum for RFC2253 distinguished name formatting
travisdowns Mar 31, 2026
097536f
tls: error queue assert to only terminate in debug builds
travisdowns May 5, 2026
7f0f26e
util/assert: add SEASTAR_DEBUG_ASSERT
travisdowns May 11, 2026
db2b0dd
build: add --tls-mode flag and SEASTAR_TLS_DUAL_BACKEND macro
travisdowns May 11, 2026
8a6c605
net/tls: statically initialize ERROR_* globals in single-backend builds
travisdowns May 11, 2026
9cc4934
net/tls: rewrite top-of-namespace header comment
travisdowns May 11, 2026
0888881
core/crypto: rework provider lifecycle for single- and dual-backend b…
travisdowns May 12, 2026
5b27101
core/crypto: assert provider install/access invariants
travisdowns May 11, 2026
0dd1a13
ci: add single-backend openssl and dual-backend TLS test jobs
travisdowns May 11, 2026
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 .github/ai-opt-out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opt-out: true
29 changes: 29 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,32 @@ jobs:
mode: release
enables: --enable-dpdk
options: --cook dpdk --dpdk-machine corei7-avx
# disable dpdk build as we don't use it an it is
# long and breaks now and then: it still runs
# upstream
if: false

build_with_dual_tls:
name: "Test with both TLS backends"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: debug
options: --tls-mode=both

build_with_openssl_tls:
name: "Test with OpenSSL TLS backend only"
uses: ./.github/workflows/test.yaml
strategy:
fail-fast: false
with:
compiler: clang++
standard: 23
mode: debug
options: --tls-mode=openssl

build_with_cxx_modules:
name: "Test with C++20 modules enabled"
Expand All @@ -51,6 +77,9 @@ jobs:
mode: debug
enables: --enable-cxx-modules
enable-ccache: false
# disable modules build as we aren't using module and it is quite
# broken at the moment
if: false

fuzz_test:
name: "Fuzz Tests"
Expand Down
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,13 @@ seastar_generate_protobuf (
IN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/proto/metrics2.proto
OUT_DIR ${Seastar_GEN_BINARY_DIR}/src/proto)

set_option_if_package_is_found (Seastar_GNUTLS GnuTLS)
set_option_if_package_is_found (Seastar_OPENSSL OpenSSL)
option (Seastar_GNUTLS "Enable the GnuTLS-based TLS backend" ON)
option (Seastar_OPENSSL "Enable the OpenSSL-based TLS backend" OFF)

if (NOT Seastar_GNUTLS AND NOT Seastar_OPENSSL)
message (FATAL_ERROR "At least one TLS/crypto backend is required. Install GnuTLS or OpenSSL development packages.")
message (FATAL_ERROR "At least one TLS backend must be enabled. "
"Pass -DSeastar_GNUTLS=ON and/or -DSeastar_OPENSSL=ON, "
"or use configure.py --tls-mode=gnutls|openssl|both.")
endif ()

add_library (seastar
Expand Down Expand Up @@ -722,6 +724,7 @@ add_library (seastar
src/core/reactor_backend.cc
src/core/thread_pool.cc
src/core/app-template.cc
src/core/cpu_profiler.cc
src/core/disk_params.cc
src/core/dpdk_rte.cc
src/core/exception_hacks.cc
Expand Down Expand Up @@ -755,6 +758,7 @@ add_library (seastar
src/core/semaphore.cc
src/core/condition-variable.cc
src/core/crypto.cc
src/core/signal_mutex.cc
src/http/api_docs.cc
src/http/common.cc
src/http/file_handler.cc
Expand Down Expand Up @@ -1132,6 +1136,15 @@ if (Seastar_OPENSSL)
PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif ()

if (Seastar_GNUTLS AND Seastar_OPENSSL)
# Public marker: both TLS backends are compiled in, so the active backend is
# selected at reactor startup. Code that needs to handle the no-reactor case
# (e.g. static initializers, unit tests without a reactor) can use this to
# distinguish from the single-backend builds where the backend is fixed at
# compile time and available unconditionally.
target_compile_definitions (seastar PUBLIC SEASTAR_TLS_DUAL_BACKEND)
endif ()

set_option_if_package_is_found (Seastar_IO_URING LibUring)
if (Seastar_IO_URING)
list (APPEND Seastar_PRIVATE_COMPILE_DEFINITIONS SEASTAR_HAVE_URING)
Expand Down
4 changes: 2 additions & 2 deletions apps/memcached/memcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ class ascii_protocol {
private:
static void append(std::vector<temporary_buffer<char>>& bufs, const char* buf, size_t size) {
if (size) {
bufs.emplace_back(const_cast<char*>(buf), size, deleter());
bufs.push_back(temporary_buffer<char>::maybe_unsafe_from_deleter(const_cast<char*>(buf), size, deleter()));
}
}

Expand All @@ -917,7 +917,7 @@ class ascii_protocol {

append(bufs, msg_crlf);
append(bufs, item->value());
bufs.emplace_back(const_cast<char*>(msg_crlf), strlen(msg_crlf), make_deleter([item = std::move(item)]{}));
bufs.push_back(temporary_buffer<char>::maybe_unsafe_from_deleter(const_cast<char*>(msg_crlf), strlen(msg_crlf), make_deleter([item = std::move(item)]{})));
}

template <bool WithVersion>
Expand Down
5 changes: 5 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def resolve_compilers_for_compiler_cache(args, compiler_cache):
arg_parser.add_argument('--verbose', dest='verbose', action='store_true', help='Make configure output more verbose.')
arg_parser.add_argument('--scheduling-groups-count', action='store', dest='scheduling_groups_count', default='16',
help='Number of available scheduling groups in the reactor')
arg_parser.add_argument('--tls-mode', action='store', dest='tls_mode',
choices=['gnutls', 'openssl', 'both'], default='gnutls',
help='TLS backend(s) to enable: gnutls (default), openssl, or both')

add_tristate(
arg_parser,
Expand Down Expand Up @@ -289,6 +292,8 @@ def configure_mode(mode):
'-DBUILD_SHARED_LIBS={}'.format('yes' if mode in ('debug', 'dev') else 'no'),
'-DSeastar_API_LEVEL={}'.format(args.api_level),
'-DSeastar_SCHEDULING_GROUPS_COUNT={}'.format(args.scheduling_groups_count),
'-DSeastar_GNUTLS={}'.format('ON' if args.tls_mode in ('gnutls', 'both') else 'OFF'),
'-DSeastar_OPENSSL={}'.format('ON' if args.tls_mode in ('openssl', 'both') else 'OFF'),
tr(args.exclude_tests, 'EXCLUDE_TESTS_FROM_ALL'),
tr(args.exclude_apps, 'EXCLUDE_APPS_FROM_ALL'),
tr(args.exclude_demos, 'EXCLUDE_DEMOS_FROM_ALL'),
Expand Down
124 changes: 70 additions & 54 deletions demos/tls_echo_server.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,70 +46,86 @@ class echoserver {
seastar::gate _gate;
bool _stopped = false;
bool _verbose = false;

future<stop_iteration> run_once() {
if (_stopped) {
return make_ready_future<stop_iteration>(stop_iteration::yes);
}
return with_gate(_gate, [this] {
return _socket.accept().then([this](accept_result ar) {
::connected_socket s = std::move(ar.connection);
socket_address a = std::move(ar.remote_address);
if (_verbose) {
std::cout << "Got connection from "<< a << std::endl;
}
auto strms = make_lw_shared<streams>(std::move(s));
return repeat([strms, this]() {
return strms->in.read().then([this, strms](temporary_buffer<char> buf) {
if (buf.empty()) {
if (_verbose) {
std::cout << "EOM" << std::endl;
}
return make_ready_future<stop_iteration>(stop_iteration::yes);
}
sstring tmp(buf.begin(), buf.end());
if (_verbose) {
std::cout << "Read " << tmp.size() << "B" << std::endl;
}
return strms->out.write(tmp).then([strms]() {
return strms->out.flush();
}).then([] {
return make_ready_future<stop_iteration>(stop_iteration::no);
});
});
}).then([strms]{
return strms->out.close();
}).handle_exception([](auto ep) {
std::cout << "Exception: " << ep << std::endl;
}).finally([this, strms]{
if (_verbose) {
std::cout << "Ending session" << std::endl;
}
return strms->in.close();
});
}).handle_exception([this](auto ep) {
if (!_stopped) {
std::cerr << "Error: " << ep << std::endl;
}
}).then([this] {
return make_ready_future<stop_iteration>(_stopped ? stop_iteration::yes : stop_iteration::no);
});
});
}
public:
echoserver(bool verbose = false)
: _certs(make_shared<tls::server_credentials>(make_shared<tls::dh_params>()))
, _verbose(verbose)
{}

future<> listen(socket_address addr, sstring crtfile, sstring keyfile, tls::client_auth ca = tls::client_auth::NONE) {
_certs->set_client_auth(ca);
return _certs->set_x509_key_file(crtfile, keyfile, tls::x509_crt_format::PEM).then([this, addr] {
::listen_options opts;
opts.reuse_address = true;
future<> listen(socket_address addr, sstring crtfile, sstring keyfile, sstring cafile) {
_certs->set_dn_verification_callback([](seastar::tls::session_type, sstring subject, sstring issuer){
std::cout << "DN Verification callback, subject: " << subject << " issuer: " << issuer << std::endl;
});
auto f = make_ready_future();
auto cauth = tls::client_auth::NONE;
if (cafile != "") {
cauth = tls::client_auth::REQUIRE;
f = _certs->set_x509_trust_file(cafile, tls::x509_crt_format::PEM);
}
_certs->set_client_auth(cauth);
return f.then([this, addr, crtfile, keyfile] {
return _certs->set_x509_key_file(crtfile, keyfile, tls::x509_crt_format::PEM).then([this, addr] {
::listen_options opts;
opts.reuse_address = true;

_socket = tls::listen(_certs, addr, opts);
_socket = tls::listen(_certs, addr, opts);

// Listen in background.
(void)repeat([this] {
if (_stopped) {
return make_ready_future<stop_iteration>(stop_iteration::yes);
}
return with_gate(_gate, [this] {
return _socket.accept().then([this](accept_result ar) {
::connected_socket s = std::move(ar.connection);
socket_address a = std::move(ar.remote_address);
if (_verbose) {
std::cout << "Got connection from "<< a << std::endl;
}
auto strms = make_lw_shared<streams>(std::move(s));
return repeat([strms, this]() {
return strms->in.read().then([this, strms](temporary_buffer<char> buf) {
if (buf.empty()) {
if (_verbose) {
std::cout << "EOM" << std::endl;
}
return make_ready_future<stop_iteration>(stop_iteration::yes);
}
sstring tmp(buf.begin(), buf.end());
if (_verbose) {
std::cout << "Read " << tmp.size() << "B" << std::endl;
}
return strms->out.write(tmp).then([strms]() {
return strms->out.flush();
}).then([] {
return make_ready_future<stop_iteration>(stop_iteration::no);
});
});
}).then([strms]{
return strms->out.close();
}).handle_exception([](auto ep) {
}).finally([this, strms]{
if (_verbose) {
std::cout << "Ending session" << std::endl;
}
return strms->in.close();
});
}).handle_exception([this](auto ep) {
if (!_stopped) {
std::cerr << "Error: " << ep << std::endl;
}
}).then([this] {
return make_ready_future<stop_iteration>(_stopped ? stop_iteration::yes : stop_iteration::no);
// Listen in background.
(void)repeat([this] {
return run_once();
});
});
return make_ready_future();
});
return make_ready_future();
});
}

Expand Down
4 changes: 3 additions & 1 deletion demos/tls_echo_server_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int main(int ac, char** av) {
app.add_options()
("port", bpo::value<uint16_t>()->default_value(10000), "Server port")
("address", bpo::value<std::string>()->default_value("127.0.0.1"), "Server address")
("ca,a", bpo::value<std::string>()->default_value(""), "Server CA chain file")
("cert,c", bpo::value<std::string>()->required(), "Server certificate file")
("key,k", bpo::value<std::string>()->required(), "Certificate key")
("verbose,v", bpo::value<bool>()->default_value(false)->implicit_value(true), "Verbose")
Expand All @@ -46,6 +47,7 @@ int main(int ac, char** av) {
seastar_apps_lib::stop_signal stop_signal;
auto&& config = app.configuration();
uint16_t port = config["port"].as<uint16_t>();
auto ca = config["ca"].as<std::string>();
auto crt = config["cert"].as<std::string>();
auto key = config["key"].as<std::string>();
auto addr = config["address"].as<std::string>();
Expand All @@ -61,7 +63,7 @@ int main(int ac, char** av) {
auto stop_server = deferred_stop(server);

try {
server.invoke_on_all(&echoserver::listen, socket_address(ia), sstring(crt), sstring(key), tls::client_auth::NONE).get();
server.invoke_on_all(&echoserver::listen, socket_address(ia), sstring(crt), sstring(key),sstring(ca)).get();
} catch (...) {
std::cerr << "Error: " << std::current_exception() << std::endl;
return 1;
Expand Down
11 changes: 11 additions & 0 deletions demos/tls_simple_client_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int main(int ac, char** av) {
("port", bpo::value<uint16_t>()->default_value(10000), "Remote port")
("address", bpo::value<std::string>()->default_value("127.0.0.1"), "Remote address")
("trust,t", bpo::value<std::string>(), "Trust store")
("certificate", bpo::value<std::string>(), "Certficiate")
("key,k", bpo::value<std::string>(), "Private Keyfile")
("msg,m", bpo::value<std::string>(), "Message to send")
("bytes,b", bpo::value<size_t>()->default_value(512), "Use random bytes of length as message")
("iterations,i", bpo::value<size_t>()->default_value(1), "Repeat X times")
Expand Down Expand Up @@ -68,6 +70,15 @@ int main(int ac, char** av) {
f = certs->set_x509_trust_file(config["trust"].as<std::string>(), tls::x509_crt_format::PEM);
}

if (config.count("certificate") && config.count("key")) {
f = f.then([certs,
cert = config["certificate"].as<std::string>(),
key = config["key"].as<std::string>()]{
return certs->set_x509_key_file(cert, key, tls::x509_crt_format::PEM);
});
}


seastar::shared_ptr<sstring> msg;

if (config.count("msg")) {
Expand Down
2 changes: 1 addition & 1 deletion demos/udp_zero_copy_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class server {
if (_copy) {
bufs.emplace_back(temporary_buffer<char>(chunk, _chunk_size));
} else {
bufs.emplace_back(temporary_buffer<char>(chunk, _chunk_size, deleter()));
bufs.emplace_back(temporary_buffer<char>::maybe_unsafe_from_deleter(chunk, _chunk_size, deleter()));
}
chunk += _chunk_size;
}
Expand Down
Loading
Loading