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.
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.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!userver-all.deb packages could be build via: :: (for example userver::core) and now attempt to find an installed userver. Now in CMake component names with :: work regardless of the framework installation (CPM, add_subdirectory, or find_package).cmake --install was implemented. See userver_install for more info.libmongoc are supported in userver-mongo.on by default.http_server_digest_auth_secret key via components::Secdist. Many thanks to Mingaripov Niyaz for the PR!unix-socket-path static option to listen on unix domain socket path instead of an inet socket.formats::*::ValueBuilder now support std::string_view. Thanks to Андрей Будиловский for the bug report!SSUBSCRIBE and removes dead nodes.engine::WaitAny(socket.GetReadableBase(), task1, tls_socket.GetWritableBase(), future1);http_parser to a 156% faster llhttp.std::chrono::steady_clock::now() callStrCaseHash construction (2 calls into std::uniform_int_distribution<std::uint64_t> over std::mt19937)dynamic_config::Snapshot construction (at least one atomic CAS)std::shared_ptr variables in implementation.log_level to filter out messages with lower log level in the service itself and minimize CPU and memory consumption during tests.address to select network interface to listen to.INCLUDE_DIRECTORIES is now used in userver_add_grpc_library. Thanks to Nikita for the PR!SELECT statements and retrieving the results in one roundtrip.now() calls and measures time more precisely.ghcr.io/userver-framework/ubuntu-22.04-userver-base:latest. It contains all the build dependencies preinstalled and a proper setup of PPAs with databases, compilers and tools.venv instead of the older virtualenv.__default__ behavior, and for dynamic configs.full-update-jitter default value is now full-update-interval / 10. This leads to more responsive databases on full update on multiple instances of the service.format static config option, simplifying userver based services setup with unified agent.google.protobuf.Value in userver/ugrpc/proto_json.hpp.Subscribe methods (for example - YDB).lld used by default if it is available and the compiler is clangbash is not required any more by the build scripts.thread_local.tls.ca option for client-side certificates check.full-update-jitter option to avoid simultaneous full updates in different servers.userver_setup_environment() function is used to setup the environment:userver_testsuite_add_simple() CMake function call. add_grpc_library() renamed to userver_add_grpc_library().USERVER_PIP_USE_SYSTEM_PACKAGES and USERVER_PIP_OPTIONS CMake options now allow building the userver without internet connection. Thanks to Nikita for the PR!check-user-types option to prevent service from starting if database is not ready for work (for example: some migrations were not applied).discard-all-on-connect - to force running DISCARD ALL on new connections, which could be useful for some PostgreSQLs smart-proxies that reuse the same connections.alert-on-failing-to-update-times to fire an alert if the cache update failed specified amount of times in a row.dl_phdr_info items is not ON by default, leading up to multiple seconds faster exception handling under heavy load when parts of the executable still being on hard drive rather than in memory. Use USERVER_DISABLE_PHDR_CACHE CMake option to disable it, if the framework reports dlopen usage after component start and there's no way to avoid it.USERVER_FEATURE_ERASE_LOG_WITH_LEVEL to totally eliminate all the CPU and binary size overhead from logging.fsync directories, dumping caches now also do not fsync directories leading to better performance while still properly restoring after server power-off.incoming-format and new-requests-format static config options to configure the tracing headers to receive and send.max-ttl-sec to the POSTGRES_CONNECTION_SETTINGS dynamic config to force connections reopening.completion-queue-count to scale better under heavy load.dynamic-config-fallbacks component was merged into dynamic-config, see components::DynamicConfig for more info.--print-dynamic-config-defaults program option that prints all the in-code defaults of the dynamic configs.defaults option.USERVER_CHECK_AUTH_IN_HANDLERS was removed.Big new features since the Beta announcement:
Optimized and improved features that were available at the Beta announcement:
Detailed descriptions could be found below.
--initial-logger option now does nothing and will be removed soon.yaml-cpp library are now supported. Thanks to Nikita for the bug report!Realmedium sample was implemented and moved into a separate repository at userver-framework/realmedium_sample. Thanks to berholz, rumxcola, Konstantin Artemev, GasikPasik, Anna Volkova, Nikita Semenov, Daniil Boriskin, VVendor for the PR!ToString(utils::StrongTypedef<floating point>), thanks to Daniil Shvalov for the PR.userver-universal CMake target.userver-universal CMake target was refactored and is now used by the whole framework as a basic dependency. Compile times dropped down drastically for building the whole framework from scratch.SIGUSR1 and SIGUSR2 in the same class. Thanks to Beshkent for the bug report.uctl tool.#env syntax. See yaml_config::YamlConfig for more examples.access-tskv-logger static option of ugrpc::server::ServerComponent.mlock_debug_info static configuration option of components::ManagerControllerComponent is now on by default. It improves responsiveness of the service under heavy load on low memory and bad hard drives.SendAll overload that accepts const struct iovec* list, std::size_t list_size for implementing low-level vector sends. Mongo driver now uses the new function, resulting in smaller CPU and memory consumption.const std::string& parameters accepts std::string_view parameters that allow to copy less data.USERVER_FEATURE_UBOOST_CORO can be used to use system boost::context.mlock_debug_info static configuration option of components::ManagerControllerComponent now allows to lock exception unwinding information in memory. It improves responsiveness of the service under heavy load on low memory and bad hard drives.writev for empty io_vec on bulk socket writes..gitattributes now handles line endings automatically for files detected as text. This simplifies WSL builds. Thanks to Anatoly Shirokov for the PR.USERVER_OPEN_SOURCE_BUILD was removed as the build is always the same for in-house and public environments.USERVER_FEATURE_SPDLOG_TCP_SINK was removed as now the implementation of the sink does not rely on spdlog implementation.scripts/docker/Readme.md for more info.[[nodiscard]] for compile time misuse detection.geosearch and unlink commands.CMAKE_CXX_STANDARD.error-injection static option for components::Postgres was documentedminimum and maximum.--service-secdist options simplify setup of the components::Secdist in tests.ToStringView(HttpMethod) function, thanks to Фёдор Барков for the PR.set_tracing_headers to disable HTTP tracing headers, thanks to Ivan Trofimov for the PR.USERVER_PYTHON_PATH to specify the path to the python3 binary for use in testsuite tests.std::chrono::steady_clock::now() in multiple places.utils::Async invocations.start- targets for the samples, to simplify experimenting with them.-DUSERVER_FEATURE_TESTSUITE=0, thanks to Георгий Попов for the bugreport.-std=gnu++20, thanks to Георгий Попов for the PR.pkg-config.USERVER_FEATURE_UTEST flag for disabling utest and ubench target builds, thanks to Anton for the PR.const in utils::DaemonMain function, thanks to Denis Chernikov for the PR.userver_testsuite_add now can pass arguments to virtualenv, thanks to Дмитрий Изволов for the PR.os-scheduling static config option and a usage guide.make service-start-debug or make service-start-release.