Skip to content

Releases: userver-framework/userver

2.13

21 Oct 07:48

Choose a tag to compare

2.12

02 Sep 08:28

Choose a tag to compare

Changes since v2.11

  • Added infrastructure to detect IO-bound operations in transactions. See 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.

  • Added support for separate logs and traces endpoints into OpenTelemetry. See logs-endpoint and tracing-endpoint static config options of the otlp::LoggerComponent.

  • Implemented non blocking receive for engine::io::TlsWrapper. Many thanks to Denis Razinkin for the PR!

  • Added server::websocket::WebSocketConnection now has SendPing() and NotAnsweredSequentialPingsCount() functions for initiating pings on server side.

  • Created userver mirror repo at SourceCraft.

  • Kafka now supports SSL authentication. Many thanks to Timur Yalymov for the PR!

  • Fixed UB in WebSockets. Many thanks to Denis Razinkin for the PR!

  • Chaotic now handles x-usrv-cpp-container: std::unordered_set with format: uuid; x-usrv-cpp-type: userver::utils::StrongTypedef<my::CustomString, std::string>; std::intXX_t

  • Crypto part of the userver::universal now supports work with multiple std::string_views. Thanks to Dmitry Sorokin for vibe-coding the initial version of PR.

  • Google Benchmark ASLR-disabling feature enabled if supported. Many thanks to Konstantin Goncharik for the PR!

  • Simplified third-party types usage in chaotic. 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.

  • gRPC and Protobuf

  • Database drivers

  • Optimizations

    • concurrent::BackgroundTaskStorage was optimized with striped counters. Detaching a task now takes ~6% of the whole CPU usage of the detaching benchmark (before the optimizations it was ~46%).
    • storages::Query now avoids dynamic initialization when constructed from storages::Query::NameLiteral. As a result variables generated with CMake 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.
    • utils::zstring_view now used for Kafka topic names avoiding temporary string constructions.
  • Build

    • The oldest supported Python is now Python 3.9.
    • Protobuf 6.x.y is now supported. Thanks to halfdarkangel for the PR!
    • Supported by-component installation in CPack. See USERVER_INSTALL_MULTIPACKAGE CMake option for a way to enable the feature.
    • Optimized compilation time for the userver/utils/periodic_task.hpp header by removing inclusion of 7 heavy headers.
    • Improved build times by disabling modules scan. Many thanks to Konstantin Goncharik for the PR!
    • Builds are now tested on Fedora.
    • Bumped Kafka version to 4.0 in CI checks. Many thanks to MichaelKab for PR!
  • Documentation and Diagnostics:

    • Version change widget was rewritten to avoid versions hard-code. Many thanks to Lone-Marshal for the PR!
    • Added docs on Distro package maintainers roles.
    • Added more information on metadata usage into gRPC
    • 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.
    • Redis driver now does much more logging on cluster topology change to ease the cluster issues debugging.
    • Dynamic config pages with description are now generated from schemes.

Full Changelog: v2.11...v2.12

2.11

23 Jul 13:39

Choose a tag to compare

gRPC:

Other Optimizations:

  • utils::zstring_view is now used throughout the userver to avoid temporary std::string constructions. Affected components include PostgreSQL driver, HTTP clients, Chaotic, universal and Kafka.
  • URL utils for schema, query and fragment extraction now have overloads that return std::string_view and avoid dynamic memory allocations.
  • Properly make date header for S3 API. This avoids rare cases of CPU-intensive thread blocking. Many thanks to Daniil Shvalov for the PR.
  • Size of storages::redis::ReplyData dropped down to 32 bytes from 64 bytes, leading to less memory usage for responses with long arrays.
  • Optimized hex logging in Kafka. Many thanks to Mikhail Romaneev for the PR!

Documentation and Diagnostics:

Build:

  • CMAKE_CXX_STANDARD was set to to 20 by default. C++17 still supported.
  • Added preliminary CMake configure support on Windows. Many thanks to Alex for the PR.
  • Added cmake-format config and formatted the CMake files. Many thanks to Dzmitry Ivaniuk for the PR!
  • Added 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!

Full Changelog: v2.10...v2.11

2.10

04 Jun 08:01

Choose a tag to compare

  • Initial implementation of SQLite Driver. Many thanks to Turulin Zakhar for the implementation, tests and for the documentation.
  • GDB pretty printers now can list all the tasks via 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.
  • Merged a foundation for the ODBC driver. Many thanks to Alexey for the PR!
  • Redis driver now can ignore ping times to different instances to do a fair round-robin. See consider_ping field in storages::redis::CommandControl.
  • Dropped gRPC [(userver.field).secret = true];. Use [debug_redact = true]; instead.
  • Statically assert that a destructor of an object in utils::FastPimpl is noexcept. Many thanks to Шаблов Анатолий Владимирович for the PR!

Optimizations:

  • Reduced memory allocations while generating strings for ID in tracing::Span. About a 150ns speedup on average on tracing::Span construction.
  • Removed unused code and class members in Redis internals, reducing runtime memory usage and binary code size.
  • Replaced std::unique_lock with std::lock_guard where possible to simplify optimization work for the compiler.

2.9

13 May 10:10

Choose a tag to compare

2.9
  • Logging now supports fmt formatting in macro LOG_INFO("User {} logged in from {}", user_id, ip_address); and lambda formatting. See Logging and Tracing for more info.
  • PostgreSQL driver now can disable all the statements logging via static config option statement-log-mode
  • ClickHouse driver now supports doubles in the queries.
  • YDB now can be used with GCC compiler, not only Clang. YDB still requires C++20 support
  • components::Redis in sentinel mode now supports selection of database index via database_index in secdist config. Many thanks to Tikhon Sergienko for the PR!
  • PostgreSQL cache (shadow replicas) traits now support kOrderBy. With DISTINCT ON expression in kQuery it allows to store only slices of data. Many thanks to Dmitry Kopturov for the PR!
  • Added a userver-create-service script for creation of a new service. Github service templates are now deprecated.
  • Notify on state change when it actually happens in Redis Standalone. Many thanks to Nikolay Pervushin for the PR!
  • Modernized testsuite code, including removal of event_loop usages and usage of asyncio-socket.
  • Hidden thread_id and task_id for INFO+ logger levels to made the logs shorter.
  • Stack usage monitor now could be disabled in test via USERVER_GTEST_ENABLE_STACK_USAGE_MONITOR=1 environment variable.
  • gRPC
    • Added support for debug_redact and added a recommendation to use [debug_redact = true]; instead of [(userver.field).secret = true];
    • Significant speed up logging of large requests and response messages. Note that request/response logs are by default enabled with global DEBUG logging level; the behavior could be overridden by middlewares static configs of ugrpc::client::middlewares::log::Component and ugrpc::server::middlewares::log::Component.
    • Server and client logging tags are now consistent.
    • More improvements, docs and samples for middlewares. See gRPC for more info.
  • Build
    • Fixed floating point escaping compilation in ClickHouse driver. Many thanks to Ksenia-C for the PR!
    • Fix compilation errors for curl 8.13. Many thanks to Konstantin Goncharik for the PR!
    • Fix compilation errors for fmt 11. Many thanks to Konstantin Goncharik for the PR!
    • Added 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.
    • Added Debian-12 dependencies and build instructions.
    • Export only files that are not ignored by git for Conan sources. Many thanks to c0rt for the PR!
  • Documentation and Diagnostics:

2.8

12 Mar 07:47

Choose a tag to compare

2.8

Changes since v2.7:

  • 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!

  • kafka::Producer now has the API for sending Kafka headers. Many thanks to Mikhail Romaneev for the PR and to Fedor Lobanov for the fix!

  • kafka::ConsumerScope now has the API for receiving Kafka headers.

  • Add span events to OpenTelemetry via tracing::Span::AddEvent(). Many thanks to Dudnik Pavel for the PR.

  • Added logging::JsonString to explicitly describe in type system that a string contains loggable JSON. Many thanks to akhoroshev for the PR!

  • Deadline Propagation for PostgreSQL is now enabled by default and can be controlled via deadline-propagation-enabled static option of the components::Postgres.

  • Testsuite now supports @pytest.mark.uservice_oneshot.

  • utils::regex now always uses a faster and safer Re2 instead of boost::regex.

  • Dynamic config USERVER_HANDLER_STREAM_API_ENABLED is not used any more.

  • server::handlers::HttpHandlerStatic now has an expires static config option.

  • kafka::ProducerComponent and kafka::ConsumerComponent now supprt 'SASL_PLAINTEXT' security protocol. Many thanks to Mikhail Romaneev for the PR!

  • Implemented OneOf discriminator mapping to integer and generation of fmt::formatter for enums in chaotic.

  • kRoundRobin load distribution in PostgreSQL is now uniform

  • gRPC

    • Retries are now supported and controlled via dynamic config. See ugrpc::client::Qos for more info.
    • Clients and servers now use the same configuration approach for middlewares, allowing granular overrides of settings.
  • Optimizations

    • Postgres driver now uses moodycamel queue instead of boost::lockfree. Up to 2 times faster retrieval of connection from pool.
    • utils::TrivialBiMap is used in more cases, leading to faster runtime search and minor decrease in binaries size.
    • Multiple std::string constants were replaced with constinit types, leading to faster startup times and smaller binaries.
    • Avoid URL copies in clients::http::Request
  • Documentation and Diagnostics:

  • Build

    • Debug symbols of userver libraries are now compressed with zstd if the toolset supports it, leading to smaller binaries size.
    • Docker images now use zstd compression too.
    • Dropped CI testing on Ubuntu 20.04 which lifetime almost ended.
    • Improved build type matching for installed userver. Many thanks to Aleksey Ignatiev for the PR!

2.7

31 Jan 09:25

Choose a tag to compare

2.7

Changes since v2.6:

  • Logging in JSON format was implemented. See static option format at components::Logging.

  • utils::regex now uses Re2 under the hood, leading to at least x2 faster regular expression matching and guaranteed absence of backtracking. Updating is highly recommended.

  • Mongo connection state checking algorithms was adjusted to work well on small RPS.

  • Conan packages now support all the userver features. Conan package build now reuses the CMake install targets and CMake config files.

  • Full feature support for MacOS, including testing and Conan package build and usage on that platform.

  • Added support for TLS certificate chains. See tls.cert static option at components::Server. Many thanks to aklyuchev for the PR!

  • Chaotic exceptions now do not depend on JSON. Thanks to Artyom for the PR!

  • gRPC

  • Optimizations

    • Speed up configuration reads on creating new PostgreSQL connections.
    • utils::PeriodicTask now calls RCU Read two times less on each iteration.
    • Reduced memory allocations count on each Redis request.
  • Build

    • New Mongo+gRPC service template. Many thanks to Alexander Kuvaev for the PR!
    • Fixed build with USERVER_FEATURE_JEMALLOC=ON. Many thanks to Aleksey Ignatiev
      for the PR!
    • Service templates service_template, pg_service_template, pg_grpc_service_template, mongo_grpc_service_template now use "cmake presets" and "devcontainers" for out-of-the-box support of VSCode and Clion IDEs.
    • Started the work on Ubuntu 24.04 images.
    • Added 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.
    • Added missing fmt11 headers. Thanks to Pavel Sidorovich for the PR!
    • Added USERVER_USE_STATIC_LIBS to link third-party libraries statically.
    • Support pacman epoch in CMake version detection. Many thanks to Konstantin Goncharik for the PR.
  • Documentation

2.6

24 Dec 16:31

Choose a tag to compare

2.6

Changes since v2.5:

  • storages::secdist::Secdist is now automatically reloaded for Mongo, Redis and PostgreSQL databases if the secdist file was changed. Now changing the connection parameters in file does not require service restart.

  • Public parts of the Redis driver were moved out from 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.

  • Shortened testsuite logs were made more functional by providing HTTP URL info.

  • Removed old gRPC interface for server handlers as was promised in previous release notes.

  • gRPC client interfaces were changed to be more user friendly. For example, for 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.
  • Added Easy - library for single file prototyping. Now the service can be created in a few code lines:

int main(int argc, char* argv[]) {
  easy::HttpWith<>(argc, argv)
      .DefaultContentType(http::content_type::kTextPlain)
      .Route("/hello", [](const server::http::HttpRequest& /*req*/) {
          return "Hello world";  // Just return the string as a response body
      });
}

2.5

08 Nov 09:38

Choose a tag to compare

2.5

Changes since v2.4:

  • Added S3 API client s3api::Client. Many thanks to v-for-vandal for the work!

  • Added gRPC reflection library. Many thanks to v-for-vandal for the work!

  • Added Kill Switch functionality. Many thanks to Aksenov Anton for the work!

  • Congestion Control turned on by default.

  • Initial work towards embedding GDB pretty-printers to userver binaries.

  • Mongo now has the full functionality for diagnostics out-of-the box, without mongo-c library patches.

  • Simplified contributing by removing the annoying bot that checks for explicit agreement to CLA. Creating an issue or sending a PR already means agreement with CLA. Added notes to PR and Issue creation to highlight that.

  • Basic support for HTTP/2 body streaming.

  • Kafka support in testsuite implemented. See Functional tests section at Kafka service tutorial.

  • gRPC:

    • Safe new interface for gRPC server handlers. Old interface will be removed in next release.
    • Added support for TLS in gRPC.
    • Added ugrpc::server::middlewares::field_mask::Component for masking and trimming messages. Many thanks to TTPO100AJIEX for the work!
    • gRPC clients now allow configuring channels count for particular methods via dedicated-channel-counts static config option.
  • Optimizations:

  • Build:

    • Added userver_module() CMake function to simplify configuration of new drivers that are being added to userver.
    • Added missing fmt/ranges.h includes. Thanks to Vasilii Kuziakin and to SidorovichPavel for the PRs!
    • Proper use of PROTOBUF_PROTOC in CMake. Thanks to Nikita for the PR!
    • Added support for builds in paths that contain whitespaces and other special symbols.
    • Added CI build tests for Ubuntu 24.04 and MacOS.
    • Switched to Conan v2. Many thanks to Anton for the PR! Also use modern versions of third party libraries in Conan.
  • Documentation and diagnostics:

    • A whole new build dedicated section was added to the docs instead of the old "Configure, Build and Install" page.
    • Improved schemes validation messages, including config validation messages because no schema is written.
    • Disambiguated diagnostic messages for component system.
    • Better log messages for the dist locks.
    • Better docs for gRPC middlewares and gRPC logs at gRPC.
    • Added topology and heartbeats logs and metrics for Mongo.
    • Clarified docs on PostgreSQL data types with timezones. See uPg: Supported data types.
    • Added Kafka service tutorial.
    • Logging at runtime, Congestion Control documentation rewrite.

2.4

18 Sep 14:49

Choose a tag to compare

2.4

Changes since v2.3:

  • Added USERVER_LOG_REQUEST_HEADERS_WHITELIST to control the HTTP headers to log.
  • OpenTelemetry protocol (OTLP) now can optionally do only logging or only tracing. Thanks to TertiumOrganum1 for the PR!
  • The framework now accepts OTLP headers for tracing by default and puts those headers for new requests.
  • PostgreSQL span names are now a little bit more informative. Thanks to TertiumOrganum1 for the PR!
  • Kafka now has a client.id static option. Many thanks to Nikolay Pervushin for the PR.
  • PostgreSQL type errors become more informative. Thanks to farmovit for the report!
  • Optimizations:
    • HTTP/2 server implementation now does not copy data to send, saving CPU and RAM.
    • HTTP/2 now relies on open-addressing unordered map from nghttp2, leading to faster stream lookup.
    • Kafka consumer now does not block a task processor thread, allowing multiple consumers to share the same OS thread. Consume cycle now can be treated as an asynchronous non-blocking event loop.
    • Kafka producer delivery acknowledgments processing is now done in parallel, leading to better scalability. Also it does not block the OS thread when waiting for new delivery acknowledgments.
    • Internals of all the Sockets became smaller in size, saving some RAM.
  • gRPC:
  • Build, Install and CI:
    • OTLP build is now supported in Conan. Thanks to Amina Ramazanova for the PR!
    • Chaotic now exposes less headers, leading to faster build times.
    • Fixed compilation on modern Boost.UUID. Thanks to Alexander Botev for the PR!
    • Added dependabot to CI and updated the dependencies. Thanks to Dzmitry Ivaniuk for the PR!
    • Added missing #include. Thanks to Nikita for the PR!
    • Removed outdated defines in the core. Thanks to Sergey Kazmin for the PR!
    • Install now does not put third party headers into the top level include directory. Multiple unused files are now not installed.
    • Started the work to enable builds in directories with whitespace in names.
  • Documentation: