aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
AgeCommit message (Collapse)Author
2017-05-17Add persistence to history of the non-legacy shellFred Hebert
This patch adds a mechanism by which shell history gets stored persistently on disk and gets loaded whenever a new shell session begins. The log files are added to the user's cache directory, with multiple files in it, although the location is configurable. All Erlang instances on a given host will share the same log file. There are two hook points in group.erl that are used: when instantiating the buffer, where we fetch from disk, and when adding a line to the buffer (gets stored). This allows all shell instances to use the same base set of lines when loaded, but to keep their history separate after the fact. As lines are added as you go, a new shell session (with ^G -> s -> c) will have access to previous sessions' lines. The implementation makes use of the disk_log library with a rotating log in order to store data, and allow automated repairs. By default, the feature is disabled and must be turned on through OTP environment variable part of the kernel application. The options include: | Option | Accepted values | Default | Description | | ------------------------ | ----------------- |---------- | -------------------- | | shell_history | enabled, disabled | disabled | turn feature on/off | | shell_history_path | any string | user cache| where to put files | | shell_history_file_bytes | 51200..N bytes | 512kb | max data size (>50kb)| | shell_history_drop | ["q().", ...] | [] | blacklisted lines | A version header is added to the disk_log configuration, allowing changes in the storage format to be enacted in the future (i.e. adding segmentation by node name in the same file, or encoding) without conflict. Log rotation is used with multiple log files to ensure proper enforcement of resizing without too much data loss. Because disk_log does not allow to just flush bits of content on rewrite (it truncates any full file), we instead use a wrap log and try to divide the configured size into up to 10 log files so that every time we rotate a log, we lose only 10% of the data. This remains true for corrupted files that cannot fully be repaired. This many-logs-based approach in turn forces the use of a minimal log size for the `shell_history_file_bytes` configuration, since it has to be divided by 10. The shell history is not loaded for the `user` process which, despite running the group.erl module, does not actually require history as it mostly just forwards IO protocol information.
2017-05-17add option 'quiet' to disk_logFred Hebert
This option allows to suppress output of info_msgs to error_logger when recoverable errors are encountered in disk_log by setting the value to 'true'. Defaults to 'false', the backwards compatible behaviour.
2017-05-17Fix type declaration for disk_log.hrlFred Hebert
A specific type was given as an atom rather than an actual type defintion.
2017-05-06Fix typo in child spec for file_serverBen Tyler
'modeules' -> 'modules' Introduced in 3edc6dbf8f150bb6ba7c800ed5cc379771f8b279 (present in 20.0-rc1, but not in the 19 release series).
2017-05-05Revert "Prepare release"Raimo Niskanen
This reverts commit dc57404252c47520f352834ad9be45ad684f96c9.
2017-05-04Prepare releaseErlang/OTP
2017-05-04Update copyright yearRaimo Niskanen
2017-05-04Fix missing release noteRaimo Niskanen
2017-04-28Merge branch 'zandra/kernel/nodenames/OTP-13805'Zandra Norman
* zandra/kernel/nodenames/OTP-13805: kernel: Do not allow unicode in nodenames
2017-04-28kernel: Do not allow unicode in nodenamesZandra Norman
Verify that unicode isn't used in a node name and logi an info message if it is. Filter the head part of the name a bit harder to work with epmd.
2017-04-25Kernel: fix file_name_SUITE:icky test caseZandra Norman
2017-04-20implement SO_BINDTODEVICE for inet protocolsAndreas Schultz
bind to device is needed to properly support VRF-Lite under Linux (see [1] for details). [1]: https://www.kernel.org/doc/Documentation/networking/vrf.txt
2017-04-20Merge branch 'lukas/erts/20_minor_fixes'Lukas Larsson
* lukas/erts/20_minor_fixes: erts: Rebuild etc executables if config.h changes erts: Fix new gcc warning in check io kernel: Add mem check to prim_file:large_write tc erts: Fix two compiler warnings on OS X erts: Fix erts_debug:df function info output erts: Get rid of some unused function warnings on os x
2017-04-20kernel: Add mem check to prim_file:large_write tcLukas Larsson
2017-04-12Merge branch sverker/remove-latin1-atom-encoding/OTP-14337Sverker Eriksson
* sverker/remove-latin1-atom-encoding: kernel: Fix erl_distribution_wb_SUITE:whitebox kernel: Remove pg2_SUITE:compat erts: Remove fun_r13_SUITE stdlib: Remove test cases for R12 io protocol kernel: Make DFLAG_UTF8_ATOMS mandatory kernel: Rewrite distribution flag verification tools: Update assumptions in lcnt about external atom format stdlib: Tweak beam_lib_SUITE whitebox assumptions orber: Remove hard dependency to external atom format kernel: Try mend disk_log whitebox tests erts: Mark latin1 atom encoding as deprecated jinterface: Do not generate atoms on old latin1 external format erl_interface: Do not generate atoms on old latin1 ext format erts: Do not generate atoms on old latin1 external format erts: Fix faulty ASSERT for failed dec_term
2017-04-07Merge branch 'bjorn/cuddle-with-tests'Björn Gustavsson
* bjorn/cuddle-with-tests: Ensure code_SUITE:on_load_embedded/1 does not leak links
2017-03-31Merge branch 'egil/kernel/refactor-supervisor/OTP-14315'Björn-Egil Dahlberg
* egil/kernel/refactor-supervisor/OTP-14315: Update primary bootstrap kernel: Refactor supervision tree
2017-03-30kernel: Refactor supervision treeBjörn-Egil Dahlberg
Use maps in definitions to make them more readable.
2017-03-28Merge branch 'lukas/kernel/gen_tcp_close_docs'Lukas Larsson
* lukas/kernel/gen_tcp_close_docs: kernel: Expand gen_tcp:close docs with send text
2017-03-28kernel: Expand gen_tcp:close docs with send textLukas Larsson
This commit attempts to clarify some of the guarantees given by the TCP standard when issuing close. This is quite a complex topic so there are probably corner cases still left, but this at least tells the user that things can go wrong when doing a close.
2017-03-20kernel: Fix erl_distribution_wb_SUITE:whiteboxSverker Eriksson
for OTP 20.
2017-03-20kernel: Remove pg2_SUITE:compatSverker Eriksson
as it tests removed compatibility with R13 node.
2017-03-16Merge branch 'vans163/patch-1/PR-1319'Ingela Anderton Andin
* vans163/patch-1/PR-1319: Update inet.xml. Note buffer relation to MTU
2017-03-16Update inet.xml. Note buffer relation to MTUvans163
The documentation does not indicate this is the buffer responsible for the maximum bytes we can receive from a recv call.
2017-03-14Merge branch 'maint'Rickard Green
* maint: Updated OTP version Prepare release Conflicts: OTP_VERSION lib/typer/doc/src/notes.xml lib/typer/vsn.mk
2017-03-14Prepare releaseErlang/OTP
2017-03-14Merge branch 'hasse/fix_erl_anno_use'Hans Bolinder
* hasse/fix_erl_anno_use: parsetools: Fix handling of locations and annotations diameter: Fix handling of locations and annotations kernel: Fix handling of locations and annotations compiler: Fix handling of locations and annotations eunit: Fix handling of locations and annotations Update preloaded erts: Fix handling of locations and annotations dialyzer: Fix handling of annotations in a test debugger: Fix handling of locations and annotations stdlib: Extend functions in erl_parse to handle form_info() stdlib: Fix handling of locations and annotations erts: Correct the documentation of abstract end-of-file stdlib: Add debug tests to the erl_parse module stdlib: improve the erl_anno module's debug tests stdlib: Improve the erl_pp module's debug tests
2017-03-13kernel: Make DFLAG_UTF8_ATOMS mandatorySverker Eriksson
2017-03-13kernel: Rewrite distribution flag verificationSverker Eriksson
2017-03-10kernel: Try mend disk_log whitebox testsSverker Eriksson
after atom encoding got 1 byte smaller when changed from <<$d, Len:16, Bytes/binary>> to <<$w, Len:8, Bytes/binary>>
2017-03-10Update copyright yearRickard Green
2017-03-09Merge branch 'maint'Siri Hansen
Conflicts: lib/kernel/src/kernel.appup.src lib/stdlib/src/stdlib.appup.src
2017-03-08Remove typer applicationSiri Hansen
The application now has an own repo, https://github.com/erlang/typer
2017-03-08kernel: Fix handling of locations and annotationsHans Bolinder
2017-03-08Update appups in kernel and stdlib for OTP-19.3Siri Hansen
2017-03-01Ensure code_SUITE:on_load_embedded/1 does not leak linksBjörn Gustavsson
Make sure that the symlink created in the lib directory is deleted even if the test case fails.
2017-02-22Merge branch 'maint'Lukas Larsson
2017-02-22Merge branch 'lukas/kernel/fix_os_cmd_close_race/OTP-14232' into maintLukas Larsson
* lukas/kernel/fix_os_cmd_close_race/OTP-14232: kernel: Fix hanging os:cmd race condition
2017-02-22Merge branch 'maint'Lukas Larsson
2017-02-21kernel: Fix hanging os:cmd race conditionLukas Larsson
If the port terminates before Port ! close is issued, there will be no 'closed' reply, so the old code would hang. As it turns out there is no way to figure out if a closed reply is supposed to come as that reply is sent after all links and monitors are triggered. So we have to use the synchronous port_close to close the port.
2017-02-20kernel: Fail sticky_dir tc if module not stickyLukas Larsson
Running this test when for some reason stdlib has been unstickied could cause the emulator to die. So we check first to make sure that the expected files are sticky.
2017-02-15Merge branch 'fix-source-typos'Björn Gustavsson
* fix-source-typos: (25 commits) Fixed typos in system/doc Fixed typos in lib/xmerl Fixed typos in lib/wx Fixed typos in lib/stdlib Fixed typos in lib/snmp Fixed typos in lib/ssl Fixed typos in lib/ssh Fixed typos in PKCS-8.asn1 file Fixed typos in lib/parsetools Fixed typos in lib/orber Fixed typos in lib/mnesia Fixed typos in lib/megaco Fixed typos in lib/kernel Fixed typos in lib/jinterface Fixed typos in lib/inets Fixed typos in lib/hipe Fixed typos in lib/eunit Fixed typos in lib/erl_interface Fixed typos in lib/eldap Fixed typos in lib/edoc ...
2017-02-15Merge branch 'jur0/fix-function-name'Björn Gustavsson
* jur0/fix-function-name: Fix function name
2017-02-14Fixed typos in lib/kernelAndrew Dryga
2017-02-11Fix function nameJuraj Hlista
From camel case to snake case.
2017-02-09Merge pull request #1312 from richcarl/shell-smart-compileBjörn Gustavsson
Extend shell c(...) to find and recompile modules OTP-14190
2017-02-06Use magic refs for code loading stateRickard Green
2017-02-06Document the kernel source_search_rules parameterRichard Carlsson
2017-02-06Merge branch 'maint'Björn Gustavsson
* maint: Store messages for 'rex' and 'error_logger' off heap file: match enoent and enotdir in path_open
2017-02-06Merge pull request #1328 from bjorng/bjorn/kernel/off-heap-message/OTP-14142Björn Gustavsson
Store messages for 'rex' and 'error_logger' off heap OTP-14192