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
andconst_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
andcaf.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
andget_or
model type conversions on aconfig_value
. For example,get_as<int>(x)
would convert the content ofx
to anint
by either casting numeric values toint
(with bound checks) or trying to parse the input ofx
if it contains a string. The functionget_or
already existed forsettings
, but we have added new overloads for generalizing the function toconfig_value
as well. - The
typed_response_promise
received additional member functions to mirror the interface of the untypedresponse_promise
. - ๐ง Configuration files now allow dot-separated notation for keys. For example,
users may write
caf.scheduler.max-threads = 4
instead of the nested formcaf { scheduler { max-threads = 4 } }
.
๐ Deprecated
- The new
get_as
andget_or
function pair makes type conversions on aconfig_value
viaget
,get_if
, etc. obsolete. We will retain the STL-style interface for treating aconfig_value
as avariant
-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
andapply_value
. Instead, inspectors only offerapply
and users may now also callmap
,list
, andtuple
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 optionmsg
. 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 eitherdispatch
ordelegate
.
๐ 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
frominspect
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 toconst char*
todeep_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 forcaf_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 asdetail
orio
(#1195). - Solved a race condition on detached actors that blocked ordinary shutdown of actor systems in some cases (#1196).
- The enum