Age | Commit message (Collapse) | Author |
|
Takes the name of the child (or Pid, in the case of a
simple_one_for_one supervisor) and returns the map which specifies the
child.
|
|
Earlier, supervisor flags and child specs were given as tuples. While
this is kept for backwards compatibility, it is now also allowed to
give these parameters as maps:
-type sup_flags() :: #{strategy => strategy(), % optional
intensity => non_neg_integer(), % optional
period => pos_integer()} % optional
-type child_spec() :: #{id => child_id(), % mandatory
start => mfargs(), % mandatory
restart => restart(), % optional
shutdown => shutdown(), % optional
type => worker(), % optional
modules => modules()} % optional
Default values are as follows:
Supervisor flags:
strategy: one_for_one
intensity: 1
period: 5
Child specs:
restart: permanent
type: worker
shutdown: 5000 for workers, 'infinity' for supervisors
modules: [M], where M comes from the child's start {M,F,A}
Some of these default values are quite hard to decide on, since there
really is no "most common way". It always depends on the use case. So
we decided that the most important reason for having default values is
to lower the start barrier and get "something" running. For production
use, most systems must be fine tuned in this respect anyway.
This is how we reasoned about it:
Strategy: just pick one - and 'one_for_one' was most used in OTP.
Max restart frequency (intensity/period): by allowing one restart only
we keep the important supervisor feature of restarting children, but
we also avoid the possibility of scaling to a huge amount of restarts
if the supervisor tree is deep.
Restart: just pick one - and 'permanent' is fairly common.
Shutdown for workers: to avoid the confusion of why the terminate
function is not executed, we decided not to use 'brutal_kill'. Which
number to use is probably not that important, so we chose 5000.
Shutdown for supervisors: the recommended shutdown value for
supervisors is 'infinity', so we decied to use that. Having the same
(integer) value as for workers can give very strange results.
Type: just pick one - and we believe that 'worker' is most common
|
|
Remove duplicated code related to checking of supervisor flags.
|
|
|
|
OTP-12224
* vinoski/edlin-ctrl-u:
Make shell ctrl-u save killed text correctly
|
|
* egil/maps/variable-keys/OTP-12218: (22 commits)
compiler: Update test for Maps aliasing
compiler: Properly support Map aliasing
compiler: Refactor Map pairs aliasing
compiler: Fix harmless need_heap error for Maps
stdlib: Update Map tests
stdlib: Use environment bindings for Maps keys in erl_eval matching
debugger: Update Map tests
compiler: Update Map tests
compiler: Fix v3_core Maps pair chains
compiler: Use expressions in core patterns
compiler: Use variables in Map cerl inliner
compiler: Reintroduce binary limit for Map keys
compiler: Shameless v3_core hack for variables
compiler: Use variables in Map beam assmebler
compiler: Use variables in Map kernel pass
compiler: Use variables in Map core pass
compiler: Normalize unary ops on Maps key literals
stdlib: Update Map tests
stdlib: erl_lint Map key variables
compiler: Maps are always patterns never values in matching
...
|
|
Conflicts:
lib/stdlib/src/stdlib.appup.src
|
|
* siri/appups-17.4:
Fix stdlib.appup for OTP-17.4
|
|
* siri/filename-join-2/OTP-12158:
Fix handling of single dot in filename:join/2
|
|
Fix edlin to correctly save text killed with ctrl-u. Prior to this fix,
entering text into the Erlang shell and then killing it with ctrl-u
followed by yanking it back with ctrl-y would result in the yanked text
being the reverse of the original killed text.
Add a test for the fix to interactive_shell_SUITE.
(This is the same fix as in PR#416, but that PR was never completed.)
|
|
|
|
* ap/attribute_fun_arity_in_map/OTP-12213:
stdlib: Test Map attributes via erl_pp
stdlib: erl_parse abstract Maps
stdlib: Refactor ?line in erl_pp_SUITE:misc_attrs
stdlib: Refactor Maps farity attributes
Allow Name/Arity syntax in maps inside attributes
|
|
Conflicts:
lib/stdlib/src/erl_pp.erl
|
|
* egil/fix-erl_pp/OTP-12190:
stdlib: Handle key type expressions
|
|
|
|
* siri/new-dialyzer-gen_event/OTP-12206:
Fix dialyzer warnings for unmatched return in gen_event
|
|
|
|
* capflam/filelib_wildcard_fix:
Fix filelib:wildcard/2 when 'Cwd' ends with a dot
|
|
|
|
|
|
This was introduced by PR 445, commit
2e78c5f3e7f9991484ceb5d56e5b0086331101be.
|
|
|
|
The reference manual says that filename:join(A,B) is equivalent to
filename:join([A,B]). In some rare cases this turns out not to be
true:
1> filename:join("/a/.","b").
"/a/./b"
2> filename:join(["/a/.","b"]).
"/a/b"
In general, filename:join/1,2 removes single dots from the resulting
path, except dots that occur at the beginning or end of the path. The
problem above occurs when the first argument to join/2 ends with a
dot, then it is not removed even if the second argument differs from
an empty string and thus the dot ends up in "the middle" of the path.
This commit corrects this problem. A single dot is now only kept if it
occurs at the very beginning or the very end of the resulting path.
Test of filename:join/1,2 are added in filename_SUITE. In addition,
filelib_SUITE is updated with more tests of filelib:wildcard/2 since
this failed when the given current directory (second argument) ended
with a dot.
|
|
Conflicts:
lib/stdlib/src/gen_event.erl
|
|
* josevalim/jv-genevent:
Do not rely on macros with implicit vars
|
|
This is to allow upgrade from stdlib-2.2 (OTP-17.3).
|
|
Conflicts:
lib/stdlib/src/erl_pp.erl
|
|
* egil/fix-maps-type-pretty-print/OTP-12190:
edoc, erl_docgen: Enhance internal map type format
stdlib: Fix maps type pretty printing
|
|
|
|
* nox/fix-exporting-rules/OTP-12186:
Rewrite merge of clause variable tables (in case, try, etc)
|
|
This undocumented option makes an init:get_argument/1 call every time a gen_server
is started.
Reported-By: James Fish
|
|
|
|
Properly align union typed assoc values.
|
|
This commit also provides the benefit that the Label argument
in gen:call/3 is no longer used, as we can access the sender
in the From argument. Therefore, we should be able to change
the Label to something more relevant in the future.
|
|
* egil/erlang-get_keys/OTP-12151:
Update preloaded erlang.beam
erts: Document erlang:get_keys/0
stdlib: Auto-import erlang:get_keys/0
erts: Add spec for erlang:get_keys/0
kernel: Test BIF erlang:get_keys/0
erts: Add BIF erlang:get_keys/0
|
|
|
|
* nox/erl_scan-fix-column-tracking:
Properly track column numbers in erl_scan
|
|
|
|
* dgud/stdlib/format_status_terminate/OTP-11967:
stdlib: Call format_status even if terminate callback crashes
|
|
|
|
|
|
* kittee/maps_only:
maps:only/2 -> maps:with/2
add maps:only/2
|
|
|
|
|
|
|
|
* egil/proc_lib-optimizations/OTP-12060:
stdlib: Update dependencies to erts-6.2
erts: Update preloaded erlang.beam
stdlib: Use erlang:fun_info_mfa/1 in proc_lib:init_p/3
erts: Test erlang:fun_info_mfa/1
erts: Introduce erlang:fun_info_mfa/1
|
|
|
|
Currently Name/Arity syntax is supported in list and tuple terms. This change makes it possible to use this syntax in map terms for consistency and convenience.
Example:
-custom(#{test1 => init/2, test2 => [val/1, val/2]}).
|
|
erl_lint:icrt_export/4 has been rewritten to make the code really
follow the scoping rules of Erlang, and not just in most situations
by accident.
* The function should not depend on calling unused_vars/3 because that
function does not return variables which begins with an underscore,
something that only matters when emitting warnings. This could cause
a compiler crash if such a variable was reused afterwards.
* The variable tables from each clause are first merged together,
lists:merge/1 is safe to use because they are orddicts and thus
already sorted. This list is then traversed parallelly to the old
variable table, again taking advantage of their sorted order.
* The function does not emit warnings itself, there is no need to pass
around the lint state. In the same vein, vtunsafe/3 has been rewritten
to do more things by itself, given that all of its calls were similar.
Finally, compiled-out code has been removed.
* This reverts the code in 9ce148b1059e4da746a11f1d80a653340216c468,
which fixed the compiler crash and made erl_lint remember unsafe
variables, but forget about unused variables in the process.
* Other places of the code which relied on the old clunky behaviour were
also updated: unused and unsafe old variables are forgotten when
merging fun clauses and boolean shortcircuiting operators do not rely
on icrt_export/3 anymore.
|
|
|