aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
AgeCommit message (Collapse)Author
2018-09-17Merge branch 'raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145' into maintRaimo Niskanen
* 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
2018-09-17Write testcases for recvtos and friendsRaimo Niskanen
Use os:type() and os:version() to predict if the individual options are supposed to be supported. We'll see if this holds.
2018-09-17Merge branch 'hasse/kernel/adjust_tests' into maintHans Bolinder
* hasse/kernel/adjust_tests: kernel: Adjust disk_log tests kernel: Adjust global testcase
2018-09-14[logger] Read config before terminating handler processSiri Hansen
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.
2018-09-12[error_logger] Handle report_cb with arity 2Siri Hansen
2018-09-12[logger] Include single_line option to report_cbSiri Hansen
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.
2018-09-12[logger] Check for deadlock when removing filtersSiri Hansen
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.
2018-09-12[logger] Fix spec for handler callbacks to always return okSiri Hansen
2018-09-12[logger] Increase timetrap timer for handler_requests_under_load testSiri Hansen
2018-09-12[logger] Improve code coverage in testSiri Hansen
2018-09-12[logger] Refactor, and add error detection for configurationSiri Hansen
2018-09-12[logger] Fix logger_disk_log_h_SUITE:sync and add som debug infoSiri Hansen
2018-09-12[logger] Update doc about file options in logger_std_hSiri Hansen
2018-09-12[logger] Remove encoding option from logger_formatterSiri Hansen
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.
2018-09-12[logger] Refactor some logger internalsSiri Hansen
2018-09-06Merge branch 'maint-21' into maintRickard Green
* 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(), ...)
2018-09-05Update release notesErlang/OTP
2018-09-05Update version numbersErlang/OTP
2018-09-05kernel: Fix missing abort_connection in net_kernelSverker Eriksson
2018-09-05Fix documentation due to feedbackRaimo Niskanen
2018-09-04Implement socket option recvtos and friendsRaimo Niskanen
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.
2018-08-17Fix kernel_app doc logger_level default from info to noticetarabit190
The doc says the default kernel logger_level is info, it should be notice. Please refer to commit 0d52b992c30eff8604e5a5363510fea38c712263 for more info.
2018-08-15lukas/kernel/logger_set_app_lvl/PR-1843/OTP-15146Lukas Larsson
Add logger:set_application_level/2
2018-08-13[logger] Avoid unwanted commas introduced by formatter's single_line optionSiri Hansen
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.
2018-08-07Merge pull request #1872 from sunboshan/patch-1Siri Hansen
Fix kernel_app doc logger_level defaults
2018-08-03erts: Fix seq_trace to not clear token for system messagesLukas Larsson
A lot of erts internal messages used behind APIs to create non-blocking calls, e.g. port_command, would cause the seq_trace token to be cleared from the caller when it should not. This commit fixes that and adds asserts that makes sure that all messages sent have to correct token set. Fixes: ERL-602
2018-08-03Merge branch 'lukas/erts/fix_udp_realloc_bug' into maintLukas Larsson
* lukas/erts/fix_udp_realloc_bug: erts: Limit the automatic max buffer for UDP to 2^16 erts: Free udp buffer when getting EAGAIN
2018-07-30erts: Limit the automatic max buffer for UDP to 2^16Lukas Larsson
There is no reason to have a larger buffer than this as the recvmsg call will never return more data. OTP-15206
2018-07-26Merge branch 'maint-21' into maintJohn Högberg
2018-07-24Merge branch 'maint-20' into maintJohn Högberg
* maint-20: Updated OTP version Prepare release ssl: Engine key trumps certfile option inets: Prepare for release inets: Improve error handling
2018-07-20Prepare releaseErlang/OTP
2018-07-18kernel: Improve net_ticktime docsSverker Eriksson
2018-07-18Fix node crash on passing bad arguments to file:read_file_info/2John Högberg
2018-07-16Merge pull request #1873 from sunboshan/patch-2Sverker Eriksson
Fix typo in logger docs
2018-07-16Merge branch 'lukas/clean_doc_xmldir/OTP-15190' into maintLukas Larsson
* lukas/clean_doc_xmldir/OTP-15190: docs: make clean all XMLDIR
2018-07-16kernel: Add logger:set_application_level/2Lukas Larsson
OTP-15146
2018-07-14Fix typo in logger docssunboshan
2018-07-13Fix kernel_app doc logger_level defaultssunboshan
The doc says the default kernel logger_level is info, it should be notice. ``` % erl Erlang/OTP 21 [erts-10.0.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace] Eshell V10.0.3 (abort with ^G) 1> application:get_env(kernel,logger_level). {ok,notice} ```
2018-07-13docs: make clean all XMLDIRLukas Larsson
2018-07-13Merge branch 'siri/logger/post-21/OTP-15132' into maintSiri Hansen
* 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
2018-07-13[logger] Allow setting kernel parameter 'logger_level' to 'all'Siri Hansen
2018-07-13[kernel] Reduce risk of dead lock when terminating logger_supSiri Hansen
2018-07-13[logger] Fix regexp replacement for unicode stringsSiri Hansen
2018-07-13[logger] Allow report callback with two arguments returning a stringSiri Hansen
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.
2018-07-13[logger] Remove compiler warnings in testSiri Hansen
2018-07-13[logger] Fix problem with test cases waiting for handler restartPeter Andersson
2018-07-13[logger] Add ?LOG macro which takes Level as argumentSiri Hansen
2018-07-13[logger] Improve spec for set_handler_config/3 and set_primary_config/2Siri Hansen
Specify which keys and associated values are allowed.
2018-07-13[logger] Generate .png file from .diaSiri Hansen
2018-07-12Merge PR-1870 from sverker/kernel/connect-to-self/ERL-643/OTP-15182Sverker Eriksson
Fix net_kernel:connect_node/1 to local node