Age | Commit message (Collapse) | Author |
|
The old net module (in kernel) (deprecated) was removed and its
function(s) has been moved into the new module.
Also a minor updated to the info function.
OTP-14831
|
|
|
|
* raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145:
Write testcases for recvtos and friends
Fix term buffer overflow bug
Fix documentation due to feedback
Implement socket option recvtos and friends
|
|
|
|
When a handler process is terminated due to overload, it reads its
configuration from the configuration database, so it can be restarted
with the same configuration after a small delay. This was earlier done
in a different process, which was spawned off from the terminate
function. This caused a race condition, where in some cases, the
configuration was already removed before it could be read.
The reason for spawning off a process, is to avoid a deadlock due to
the call to logger:remove_handler/1.
This commit moves the call to logger:get_handler_config/1 back to the
handler process - to ensure that the data is still there, but keeps
the call to logger:remove_handler/1 in the spawned off process - to
avoid deadlock.
|
|
|
|
If the report callback function has two arguments, the second argument
is a map with options to limit the size of the log event. To even
allow a better formatting when the event shall be printed on a single
line, the new option single_line is now included in this
argument.
|
|
If a filter fails, it is removed by a call to
logger:remove_filter/1,2. If the log event that caused the failure was
issued on the logger process itself, this would earlier cause a
deadlock due to a gen_server:call to self(). This is now prevented.
|
|
|
|
|
|
|
|
The encoding option was introduced in commit
270d909696a753af022df72a404c73f2895b4a02, to allow report callbacks to
format according to a given encoding. There was, however, no
connection between this encoding option, and the encoding of the
device to which the logger handler was writing.
Since a formatter is defined to return unicode:chardata(), and in
order to avoid mismatch with the encoding of the device, the encoding
option is now removed from the formatter. The handler itself must make
sure that it does not write illegal data to its device.
|
|
|
|
* maint:
Updated OTP version
Update release notes
Update version numbers
kernel: Fix missing abort_connection in net_kernel
Prevent inconsistent node lists
Fix an endless rescheduling loop when a process is executing process_info(self(), ...)
|
|
* maint-21:
Updated OTP version
Update release notes
Update version numbers
kernel: Fix missing abort_connection in net_kernel
Prevent inconsistent node lists
Fix an endless rescheduling loop when a process is executing process_info(self(), ...)
|
|
|
|
|
|
Implement socket options recvtclass, recvtos, recvttl and pktoptions.
Document the implemented socket options, new types and message formats.
The options recvtclass, recvtos and recvttl are boolean options that
when activated (true) for a socket will cause ancillary data to be
received through recvmsg(). That is for packet oriented sockets
(UDP and SCTP).
The required options for this feature were recvtclass and recvtos,
and recvttl was only added to test that the ancillary data parsing
handled multiple data items in one message correctly.
These options does not work on Windows since ancillary data
is not handled by the Winsock2 API.
For stream sockets (TCP) there is no clear connection between
a received packet and what is returned when reading data from
the socket, so recvmsg() is not useful. It is possible to get
the same ancillary data through a getsockopt() call with
the IPv6 socket option IPV6_PKTOPTIONS, on Linux named
IPV6_2292PKTOPTIONS after the now obsoleted RFC where it originated.
(unfortunately RFC 3542 that obsoletes it explicitly undefines
this way to get packet ancillary data from a stream socket)
Linux also has got a way to get packet ancillary data for IPv4
TCP sockets through a getsockopt() call with IP_PKTOPTIONS,
which appears to be Linux specific.
This implementation uses a flag field in the inet_drv.c socket
internal data that records if any setsockopt() call with recvtclass,
recvtos or recvttl (IPV6_RECVTCLASS, IP_RECVTOS or IP_RECVTTL)
has been activated. If so recvmsg() is used instead of recvfrom().
Ancillary data is delivered to the application by a new return
tuple format from gen_udp:recv/2,3 containing a list of
ancillary data tuples [{tclass,TCLASS} | {tos,TOS} | {ttl,TTL}],
as returned by recvmsg(). For a socket in active mode a new
message format, containing the ancillary data list, delivers
the data in the same way.
For gen_sctp the ancillary data is delivered in the same way,
except that the gen_sctp return tuple format already contained
an ancillary data list so there are just more possible elements
when using these socket options. Note that the active mode
message format has got an extra tuple level for the ancillary
data compared to what is now implemented gen_udp.
The gen_sctp active mode format was considered to be the odd one
- now all tuples containing ancillary data are flat,
except for gen_sctp active mode.
Note that testing has not shown that Linux SCTP sockets deliver
any ancillary data for these socket options, so it is probably
not implemented yet. Remains to be seen what FreeBSD does...
For gen_tcp inet:getopts([pktoptions]) will deliver the latest
received ancillary data for any activated socket option recvtclass,
recvtos or recvttl, on platforms where IP_PKTOPTIONS is defined
for an IPv4 socket, or where IPV6_PKTOPTIONS or IPV6_2292PKTOPTIONS
is defined for an IPv6 socket. It will be delivered as a
list of ancillary data items in the same way as for gen_udp
(and gen_sctp).
On some platforms, e.g the BSD:s, when you activate IP_RECVTOS
you get ancillary data tagged IP_RECVTOS with the TOS value,
but on Linux you get ancillary data tagged IP_TOS with the
TOS value. Linux follows the style of RFC 2292, and the BSD:s
use an older notion. For RFC 2292 that defines the IP_PKTOPTIONS
socket option it is more logical to tag the items with the
tag that is the item's, than with the tag that defines that you
want the item. Therefore this implementation translates all
BSD style ancillary data tags to the corresponding Linux style
data tags, so the application will only see the tags 'tclass',
'tos' and 'ttl' on all platforms.
|
|
|
|
Add logger:set_application_level/2
|
|
|
|
When printing a map with ~p in a log message, the formatter's
single_line option in some cases introduced unwanted commas after
'=>', for example:
This is now corrected. When single_line==true, width 0 is added to all
~p and ~P control sequences in the format string.
|
|
I did not find any legitimate use of "can not", however skipped
changing e.g RFCs archived in the source tree.
|
|
OTP-15146
|
|
|
|
* siri/logger/post-21/OTP-15132:
[logger] Allow setting kernel parameter 'logger_level' to 'all'
[kernel] Reduce risk of dead lock when terminating logger_sup
[logger] Fix regexp replacement for unicode strings
Update proc_lib:report_cb to obey logger formatter's size limiting params
[logger] Allow report callback with two arguments returning a string
Don't call report_cb from cth_log_redirect - formatter does that
Add legacy test of sasl_report_file_h and size limiting
[logger] Remove compiler warnings in test
[logger] Fix problem with test cases waiting for handler restart
[logger] Add ?LOG macro which takes Level as argument
[logger] Improve spec for set_handler_config/3 and set_primary_config/2
[logger] Generate .png file from .dia
[logger] Update documentation
|
|
|
|
|
|
|
|
If the report callback is a fun of arity 2, then the second argument
is a map with the keys 'encoding', 'depth' and 'chars_limit', and the
fun must return a string which is size limited according to the given
depth and chars_limit.
If the report callback is a fun of arity 1, then it must return a
tuple containing a format string and a list of arguments. The
formatter will produce the string, and limit it's size.
|
|
Specify which keys and associated values are allowed.
|
|
|
|
to be no-op and return true
as it always has before OTP-21.0.
|
|
|
|
|
|
* siri/logger-fix:
[logger] Update documentation
[logger] Adjust priority settings in test
[logger] Unregister handler names before terminating
[logger] Stress overload_kill tests in disk_log handler
|
|
|
|
* peppe/kernel/logger_updates:
[logger] Correct documentation
[logger] Update handler documentation
[logger] Fix test suite compilation warnings
[logger] Fix failing tests
[logger] Change overload_kill_restart_after value to infinity
[logger] Change name of function sync/1 to filesync/1
[logger] Reset logger config after tests
[logger] Don't delete log file of failing test cases
[logger] Set up priority for processes generatig test bursts
[logger] Stress overload_kill tests a bit more
[logger] Remove some compiler warnings in test suites
[logger] Sort keys when testing formatter template
[logger] Skip test involving file access rights on windows
[logger] Skip some overload protection tests when using dirty schedulers
|
|
Included config files relative to sys.config directory
OTP-15137
|
|
Change the way included config files are searched in sys.config.
Search first relative to sys.config directory, then relative
to current working directory, for backward compatibility.
This permit same result when using a sys.config file in a release
or starting manually a node with -config.
Credit to Siri Hansen for test case.
|
|
|
|
|
|
|
|
|
|
|
|
Conflicts:
lib/kernel/src/logger_disk_log_h.erl
|
|
|
|
|
|
|
|
Log events issued via error_logger:info_msg or
error_logger:info_report are now forwarded to Logger with level
'notice' instead of 'info'.
Log events issued by gen_* behaviours are also changed from level
'info' to level 'notice'.
Progress reports are still 'info', and can therefore easily be
included/excluded by changing the primary log level. By default, they
are not logged.
|