We keep an eye on all the issues and feature requests at the github.com/userver-framework, at the English-speaking and Russian-speaking Telegram support chats. All the good ideas are discussed, big and important ones go to the Roadmap. We also have our in-house feature requests, those could be also found in Roadmap.
Important or interesting features go to the changelog as they get implemented. Note that there's also a Security Changelog.
Changelog news also go to the userver framework news channel.
x-request-deadline) in addition to duration deadlines (grpc-timeout); see gRPC.Big new features since the v2.0:
Binary Ubuntu 24.04 and Ubuntu 22.04 amd64 packages could be found at userver Releases.
Detailed diff against v2.16 could be found below.
-Wc99-extensions warning in PostgreSQL driver. Many thanks to Dmitry Kopturov.librdkafka local queue overflow errors within the configured delivery.timeout.ms limit. Many thanks to Dmitry Isaikin for the PR![[lifetimebound]] annotations. More lifetime errors in user code is now detected at compile time.std::enable_if with C++20 concepts. Some of the very rarely used template variables were replaced with concepts without the k prefix. User code usually not affected, but here's a migration hint for the unfortunate ones: X-Request-Deadline header in addition to X-YaTaxi-Client-TimeoutMs.ydb::TableClient::ExecuteDataQuery switched from Table Client to Query Client API.components_manager.boot-log-path in components::ManagerControllerComponent .easy library. See Easy - library for single file prototyping .group_instance_id option to kafka::ConsumerComponent .ydb::TransactionMode.SetHandlerMetricsShard in server::request::RequestContext .operator== for proto structs.execve. See listen-socket-fd parameter description in components::Server .contains_no_update method in multi_index_lru::Container and benchmarks cleanup. Many thanks to hzhdlrp for the contribution!ServerImpl::WriteTotalHandlerStatistics function. Many thanks to gabrielyanabraham for the PR!libfmt versions. Many thanks to Konstantin Goncharik for the PR!journal_mode and synchronous options definitions in components::SQLite . Many thanks to Alexey Mednyy for the PR!libfmt versions. Many thanks to Vasily Sviridov for the PR!component_manager.coro_pool.unoptimized_stack_size_multiplier option to automatically increase stack size in unoptimized builds. See components::ManagerControllerComponent .pool_timeout to kafka-consumer config in samples/kafka_service/static_config.yaml . Many thanks to Konstantin Goncharik for the PR!Sentinel/ClusterImpl, simplify inheritance and reduce binary size.pull-pin-task-queue experimental scheduler where each task gets pinned to a thread-specific queue and is executed only in that thread. See static config option 'task-processor-queue' of the components::ManagerControllerComponent for more info.boost::stacktrace / std::stacktrace in Boost.Context became more than x50 faster on LLVM version of libunwind. Other unwinding libraries could have also gained profit.[0, 16] range to UNKNOWN.use_secure_connection static config option for storages::mysql::Component. Many thanks to Yury Bogomolov for the PR.+= use for std::atomic<double> for llvm-17/libc++. Many thanks to Alexander Chernov for the PR.<ctime> include. Many thanks to Alexander Chernov for the PR.<iterator> include. Many thanks to Alexander Chernov for the PR.<fmt/ranges.h> include. Many thanks to Taras Litvinenko for the PR.CacheUpdateTrait::StartPeriodicUpdates() from your caching components.coro_pool.deadlock_detector option in components::ManagerControllerComponent.userver-create-service script, resulting in stable work of the service on older containers.rdkafka_mock.h header to workaround uncommon header location in some of the build environments. Many thanks to Vitalii for the PR!Plugins are renamed to middlewares and components::HttpClient was split into components::HttpClient and components::HttpClientCore.
.Append<components::HttpClient>() use .AppendComponentList(clients::http::ComponentList()) in your component list (see docs).For classes inherited from clients::http::Plugin :
#include <userver/clients/http/plugin.hpp> with #include <userver/clients/http/middlewares/base.hpp>return true; for clients::http::MiddlewareBase::HookOnRetry()) may be omittedFor example:
For plugin components inherited from clients::http::plugin::ComponentBase :
#include <userver/clients/http/plugin_component.hpp> with #include <userver/clients/http/middlewares/component.hpp>http-client-plugin- anymore, http-client- prefix is suggested insteadGetPlugin method to GetMiddleware, change its return type to clients::http::MiddlewareBaseFor example:
http-client: to http-client-core: in static config.If you are using or customized plugins/middlewares:
plugins to middlewaresComponent::kName{enabled: true} as values in middlewares for every components::HttpClient confighttp-client.middlewares to http-client-middleware-pipeline.middlewaresdynamic-config-http-client.middlewares.<middleware name>.enabled to false for all middlewares that are subscribed to dynamic configs updatesFor example:
CacheUpdateTrait::StopPeriodicUpdates(). Remove calls to CacheUpdateTrait::StartPeriodicUpdates() or replace them with CacheUpdateTrait::EarlyStartPeriodicUpdates() if early update is required.=, i.e. /endpoint?key1&key2. Many thanks to Norlin for the PR!GEOPOS and EXPIRE commands via storages::redis::Client member function Geopos() and Expire().cmake/tsan.suppressions.txt is now installed and used in internal CI TSan tests for universal, core and gRPC.bool values. Many thanks to Maxim Drugov for the PR!topic_client is now exposed in testsuite's YdbClient.MONGO_DEADLINE_PROPAGATION_ENABLED_V2 dynamic config. Many thanks to Spar for vibe-codding the PR at at Zero Cost Conf!#env values as string.std::initializer_list to avoid memory allocations.SSL_CTX for TLS/SSL connections. As a result memory consumption drastically reduced for TLS/SSL server with. Many thanks to DenisRazinkin for the awesome PR!fmt >= 12. Many thanks to Konstantin Goncharik for the PR!api-common-protos are now used from the main branch of the upstream, rather than from 1.50 version. Many thanks to Alexey Medvedev for the PR!SIGUSR1 to Frequently Asked Questions .enable_trx_tracker static config option into components::ManagerControllerComponent and userver/utils/trx_tracker.hpp. The detection is turned on by default and is used in HTTP clients and gRPC for PostgreSQL transactions.logs-endpoint and tracing-endpoint static config options of the otlp::LoggerComponent.SendPing() and NotAnsweredSequentialPingsCount() functions for initiating pings on server side.x-usrv-cpp-container: std::unordered_set with format: uuid; x-usrv-cpp-type: userver::utils::StrongTypedef<my::CustomString, std::string>; std::intXX_tuserver::universal now supports work with multiple std::string_views. Thanks to Dmitry Sorokin for vibe-coding the initial version of PR.userver_target_generate_chaotic CMake function now has a LINK_TARGETS parameter to provide targets with paths to chaotic serializers. For example with LINK_TARGETS userver::postgresql chaotic would find the userver/postgresql/include/userver/chaotic/io/userver/storages/postgres/time_point_tz.hpp header with storages::postgres::TimePointTz converters.ssl-credentials-options. Many thanks to aklyuchev86 for the PR!sentinel_password storages::secdist::Secdist option for authorization on sentinels with password along with password authorization on shards. Many thanks to Tikhon Sergienko for the PR!update-period for components::Secdist is now set to 10s. As a result all the databases now automatically recreate connections on connection data change in SecDist.enum into PostgreSQL text for enums with Parse() and ToString() functions. See uPg: PostgreSQL user type mappings for more info.userver_add_sql_library function are now not affected by initialization order fiasco issues and can be safely used in any static or global variable. Dynamic memory allocations are now avoided for the above cases.USERVER_INSTALL_MULTIPACKAGE CMake option for a way to enable the feature.USERVER_GTEST_ENABLE_STACK_USAGE_MONITOR environment variable name was changed to USERVER_ENABLE_STACK_USAGE_MONITOR. USERVER_ENABLE_STACK_USAGE_MONITOR is now usable not only in unit-tests, but in all the userver based applications and services.directory-file static config option that returns file in directory requests. It is set to "index.html" by default, so that http://localhost/ requests return the index.html. Option not-found-file allows customizing 404 pages.message_key_log_format to kafka::ConsumerComponent to log message key in hex. Many thanks to Mikhail Romaneev for the PR!userver::utest.utils::NullTerminatedView to utils::zstring_view to match C++29 targeted proposal P3655R1.std::int64_t narrowing to std::int32_t in Kafka. Many thanks to Mikhail Romaneev for the PR!chaotic::Array. Many thanks to Konstantin Goncharik for the PR!ugrpc::server names.std::string constructions. Affected components include PostgreSQL driver, HTTP clients, Chaotic, universal and Kafka.std::string_view and avoid dynamic memory allocations.tools/* became samples and were moved into samples/. Tests were added.*scan commands usage, added samples and more descriptions.CMAKE_CXX_STANDARD was set to to 20 by default. C++17 still supported.with_redis_tls flag for support Redis TLS in Conan. Many thanks to Mikhail Romaneev for the PR!userver_testsuite_add CMake function now works is used in subdirectory of a project. Many thanks to DmitriyH for the PR!utask list and can apply commands to all or selected tasks. For example utask apply all bt prints the backtraces of all the tasks, utask apply some_task_name bt prints the backtrace of the task with name some_task_name. See Debugging with GDB for more info. Many thanks to Maxim Belov for the brilliant implementation.consider_ping field in storages::redis::CommandControl.[(userver.field).secret = true];. Use [debug_redact = true]; instead.noexcept. Many thanks to Шаблов Анатолий Владимирович for the PR!std::unique_lock with std::lock_guard where possible to simplify optimization work for the compiler.fmt formatting in macro LOG_INFO("User {} logged in from {}", user_id, ip_address); and lambda formatting. See Logging and Tracing for more info.statement-log-modedatabase_index in secdist config. Many thanks to Tikhon Sergienko for the PR!kOrderBy. With DISTINCT ON expression in kQuery it allows to store only slices of data. Many thanks to Dmitry Kopturov for the PR!userver-create-service script for creation of a new service. Github service templates are now deprecated.event_loop usages and usage of asyncio-socket.thread_id and task_id for INFO+ logger levels to make the logs shorter.USERVER_GTEST_ENABLE_STACK_USAGE_MONITOR=0 environment variable.debug_redact and added a recommendation to use [debug_redact = true]; instead of [(userver.field).secret = true];DEBUG logging level; the behavior could be overridden by middlewares static configs of ugrpc::client::middlewares::log::Component and ugrpc::server::middlewares::log::Component.USERVER_ENABLE_DEBUG_INFO_COMPRESSION build option, that was later changed to USERVER_DEBUG_INFO_COMPRESSION. Many thanks to Konstantin Goncharik for the PRs! Compression detection algorithm was improved to check the linker compression support.sharding_strategy of the components::Redis now supports RedisStandalone configuration, that may be useful for tests or unimportant caches. Many thanks to Aleksey Ignatiev for the PR!deadline-propagation-enabled static option of the components::Postgres.USERVER_HANDLER_STREAM_API_ENABLED is not used any more.expires static config option.kRoundRobin load distribution in PostgreSQL is now uniformmoodycamel queue instead of boost::lockfree. Up to 2 times faster retrieval of connection from pool.constinit types, leading to faster startup times and smaller binaries.url copies in clients::http::Request@pytest.mark.uservice_oneshot.zstd if the toolset supports it, leading to smaller binaries size.zstd compression too.format at components::Logging.Re2 under the hood, leading to at least x2 faster regular expression matching and guaranteed absence of backtracking. Updating is highly recommended.tls.cert static option at components::Server. Many thanks to aklyuchev for the PR!*Sync methods.USERVER_FEATURE_JEMALLOC=ON. Many thanks to Aleksey Ignatiev for the PR!ubuntu-22.04-userver-pg-dev image with all the tools for development. Planning to switch to Ubuntu-24.04 and leave only 2 containers: with build dependencies to build userver, and with prebuild userver.USERVER_USE_STATIC_LIBS to link third-party libraries statically.pacman epoch in CMake version detection. Many thanks to Konstantin Goncharik for the PR.runtests documentation at Functional service tests (testsuite)impl/ directory and placed into storages::redis:: namespace. If you were relying on the old paths, see ./scripts/migrate_from_legacy_redis_ns.sh script to ease migration.HelloWorld method in protobuf we generate the old HelloWorld function along with the new AsyncHelloWorld and SyncHelloWorld functions. AsyncHelloWorld returns a ugrpc::client::ResponseFuture that can be used to retrieve the request result later in code. SyncHelloWorld retrieves the response from the future and returns the response itself. Consider replacing:HelloWorld(x).Finish() with SyncHelloWorld(x)auto res = HelloWorld(x); /* a lot of code */; res.Finish(); with auto res = AsyncHelloWorld(x); /* a lot of code*/; res.Get(); In next release we will remove the old HelloWorld and will rename SyncHelloWorld into HelloWorld.userver_embed_file CMake function to embed files into the binary. See Writing your first HTTP server for an example.graceful_shutdown_interval in components::ManagerControllerComponent.span_kind information.user, password, and secure_connection_cert parameters support for the YDB secdist. Thanks to Попов Алексей for the PR!disabled_replicas option to disable some of the replicas.GT and LT flags support in Redis ZADD. Thanks to Nikolay Pervushin for the PR!USERVER_PGO_GENERATE and USERVER_PGO_USE CMake options. See Configure, Build and Install for more info.USERVER_BUILD_ALL_LIBRARIES CMake option. See Build options for more info.USERVER_CHAOTIC_FORMAT option for CMake build. Thanks to Konstantin Goncharik for the PR.dedicated-channel-counts static config option.userver_module() CMake function to simplify configuration of new drivers that are being added to userver.fmt/ranges.h includes. Thanks to Vasilii Kuziakin and to SidorovichPavel for the PRs!PROTOBUF_PROTOC in CMake. Thanks to Nikita for the PR!client.id static option. Many thanks to Nikolay Pervushin for the PR.unix-socket-path static config option.dependabot to CI and updated the dependencies. Thanks to Dzmitry Ivaniuk for the PR!#include. Thanks to Nikita for the PR!Content-Type in samples.handler-defaults.http_version static config option of components::Server to enable.USERVER_FEATURE_OTLP CMake option. See the docs for more info.task-processor-queue static option. A more efficient work-stealing-task-queue was introduced. Many thanks to Egor Bocharov for the PR!minItems and maxItems for arrays. Many thanks to eparoshin for the PR.#env, #file and #fallback now could be used in config_vars file. See yaml_config::YamlConfig for more info. Thanks to Artyom Samuylik for the PR.[(userver.field).secret = true] option to a protobuf field in schema.grpc.server.total metricsservice_template.Find*.cmake files are not generated any more, leading to simpler code base and faster configure times.PATH variable.#file. Now the static config of the service could refer to other files.engine.coro-pool.stack-usage.max-usage-percent metric. Improved stack-overflow diagnostics.human_logs.py now supports more options and has more examples and docs embedded. Thanks to TertiumOrganum1 for the PR!find_package(userver) now implicitly calls userver_setup_environment(), includes all the helper CMake userver scripts, making the configuration simpler. Added diagnostics and fix-it hints for some of the CMake missuses.Ctrl+k hotkey now focuses on Search input. Many thanks to Fedor Alekseev for the PR!bytea usage. Thanks to TertiumOrganum1 for the PR!Big new features since the v1.0.0:
install in CMake and CPack packaging.Detailed descriptions could be found below.
Binary Ubuntu 22.04 amd64 package could be found at userver Releases.
TaskCounter now uses concurrent::StripedCounter to reduce contention on atomics on each async task construction and destruction.@snippet links in docs. Many thanks to Mingaripov Niyaz for the PR!ThreadLocal.SafeThreadLocalWorks test. Many thanks to Egor Bocharov for the PR!