C++ Actor Framework v0.18.0 Release Notes

Release Date: 2021-01-25 // about 3 years ago
  • โž• Added

    • The enum caf::sec received an additional error code: connection_closed.
    • The new byte_span and const_byte_span aliases provide convenient definitions when working with sequences of bytes.
    • The base metrics now include four new histograms for illuminating the I/O module: caf.middleman.inbound-messages-size, caf.middleman.outbound-messages-size, caf.middleman.deserialization-time and caf.middleman.serialization-time.
    • โž• The macro CAF_ADD_TYPE_ID now accepts an optional third parameter for allowing users to override the default type name.
    • The new function pair get_as and get_or model type conversions on a config_value. For example, get_as<int>(x) would convert the content of x to an int by either casting numeric values to int (with bound checks) or trying to parse the input of x if it contains a string. The function get_or already existed for settings, but we have added new overloads for generalizing the function to config_value as well.
    • The typed_response_promise received additional member functions to mirror the interface of the untyped response_promise.
    • ๐Ÿ”ง Configuration files now allow dot-separated notation for keys. For example, users may write caf.scheduler.max-threads = 4 instead of the nested form caf { scheduler { max-threads = 4 } }.

    ๐Ÿ—„ Deprecated

    • The new get_as and get_or function pair makes type conversions on a config_value via get, get_if, etc. obsolete. We will retain the STL-style interface for treating a config_value as a variant-like type.

    ๐Ÿ”„ Changed

    • 0๏ธโƒฃ When using CAF_MAIN, CAF now looks for the correct default config file name, i.e., caf-application.conf.
    • Simplify the type inspection API by removing the distinction between apply_object and apply_value. Instead, inspectors only offer apply and users may now also call map, list, and tuple for unboxing simple wrapper types. Furthermore, CAF no longer automatically serializes enumeration types using their underlying value because this is fundamentally unsafe.
    • ๐Ÿ“œ CAF no longer parses the input to string options on the command line. For example, my_app '--msg="hello"' results in CAF storing "hello" (including the quotes) for the config option msg. Previously, CAF tried to parse any string input on the command-line that starts with quotes in the same way it would parse strings from a config file, leading to very unintuitive results in some cases (#1113).
    • Response promises now implicitly share their state when copied. Once the reference count for the state reaches zero, CAF now produces a broken_promise error if the actor failed to fulfill the promise by calling either dispatch or delegate.

    ๐Ÿ›  Fixed

    • Setting an invalid credit policy no longer results in a segfault (#1140).
    • ๐Ÿ”– Version 0.18.0-rc.1 introduced a regression that prevented CAF from writing parameters parsed from configuration files back to variables. The original behavior has been restored, i.e., variables synchronize with user input from configuration files and CLI arguments (#1145).
    • โช Restore correct functionality of middleman::remote_lookup (#1146). This fixes a regression introduced in version 0.18.0-rc.1
    • ๐Ÿ›  Fixed an endless recursion when using the default_inspector from inspect overloads (#1147).
    • ๐Ÿ‘ CAF 0.18 added support for make_behavior in state classes. However, CAF erroneously picked this member function over running the function body when spawning function-based actors (#1149).
    • When passing nullptr or custom types with implicit conversions to const char* to deep_to_string, CAF could run into a segfault in the former case or do unexpected things in the latter case. The stringification inspector now matches precisely on pointer types to stop the compiler from doing implicit conversions in the first place.
    • ๐Ÿง Building executables that link to CAF on 32-bit Linux versions using GCC failed due to undefined references to __atomic_fetch symbols. Adding a CMake dependency for caf_core to libatomic gets executables to compile and link as expected (#1153).
    • ๐Ÿ›  Fixed a regression for remote groups introduced in 0.18.0-rc.1 (#1157).
    • CAF 0.18 introduced the option to set different excluded-components filters for file and console log output. However, CAF rejected all events that matched either filter. The new implementation uses the intersection of both filters to reject log messages immediately (before enqueueing it to the logger's queue) and then applies the filters individually when generating file or console output.
    • ๐Ÿ›  Fix memory leaks when deserializing URIs and when detaching the content of messages (#1160).
    • ๐Ÿ›  Fix undefined behavior in string_view::compare (#1164).
    • ๐Ÿ›  Fix undefined behavior when passing --config-file= (i.e., without actual argument) to CAF applications (#1167).
    • Protect against self-assignment in a couple of CAF classes (#1169).
    • Skipping high-priority messages resulted in CAF lowering the priority to normal. This unintentional demotion has been fixed (#1171).
    • ๐Ÿ›  Fix undefined behavior in the experimental datagram brokers (#1174).
    • Response promises no longer send empty messages in response to asynchronous messages.
    • โž• CAF_ADD_TYPE_ID now works with types that live in namespaces that also exist as nested namespace in CAF such as detail or io (#1195).
    • Solved a race condition on detached actors that blocked ordinary shutdown of actor systems in some cases (#1196).