Age | Commit message (Collapse) | Author |
|
|
|
The deep indentation makes loop/3 difficult to read and maintain.
Break out the request handling code into a separate function.
|
|
Kostis Sagonas pointed out that there is a dialyzer warning
for constructing an improper list in the following clause:
translate_response(?FILE_RESP_N2DATA = X,
[<<_:64, _:64, _:64>> | <<>>] = Data) ->
{error, {bad_response_from_port, [X | Data]}};
I don't want to change the code to somehow eliminate the warning. An
improper list has already been constructed in the efile driver itself,
and that would be difficult to fix.
Therefore, tell dialyzer to ignore warnings for improper lists
in translate_response/2.
|
|
The compact wall of arguments makes it hard to see what is actually
happening in eval_script().
Collect the arguments into a record.
|
|
Expansion of $ROOT in paths are handled specially compared to boot
variables. There is no reason $ROOT can't be handled as a boot
variable.
We can simplify the expansion of boot variables if we spend a little
extra effort upfront collecting all boot variables into a map.
Make the error checking for -boot_var arguments stricter. Only allow
-boot_var followed by exactly two arguments to help users catch
errors earlier.
|
|
The last clause in start_it/1 calls a function in some module.
It goes to great length to catch any exception and pass them on
unchanged, and if there was a normal return, it will just return
the return value. It can been seen that the entire 'catch'
construction with the reference trick is totally unnecessary.
|
|
The get_flag/3 function which returns a default value if the
flag doesn't exist, is implemented in terms of get_flag/2
which throws an exception if the flag doesn't exist.
get_flag/3 is frequently used for the flags that don't exist,
which means that means that an exception will be generated and
catched for no good reason.
Reimplement get_flag/3 so that it doesn't have to call get_flag/2
and catch an exception. Eliminate the get_flag/2 function by
writing a special purpose function for the only time it's used,
that is for retrieving the value for the -root flag. As a
side-effect, we will get a nicer error message if there is
something wrong with the -root flag.
Similarly, simplify get_flag_list/3 and remove get_flag_list/2.
We can also eliminate search/3 and use the lists:keyfind/3
BIF instead.
|
|
The handling of flags has been incrementally messed up over
time, leading to convoluted code. Rewrite the parsing and
lookup of flags. By using the appropriate data structures,
the code will become simpler.
|
|
|
|
=== OTP-18.2 ===
Changed Applications:
- asn1-4.0.1
- common_test-1.11.1
- compiler-6.0.2
- crypto-3.6.2
- dialyzer-2.8.2
- diameter-1.11.1
- erl_docgen-0.4.1
- erl_interface-3.8.1
- erts-7.2
- eunit-2.2.12
- hipe-3.14
- inets-6.1
- jinterface-1.6.1
- kernel-4.1.1
- observer-2.1.1
- parsetools-2.1.1
- public_key-1.1
- runtime_tools-1.9.2
- sasl-2.6.1
- snmp-5.2.1
- ssh-4.2
- ssl-7.2
- stdlib-2.7
- test_server-3.9.1
- tools-2.8.2
- typer-0.9.10
- wx-1.6
- xmerl-1.3.9
Unchanged Applications:
- cosEvent-2.2
- cosEventDomain-1.2
- cosFileTransfer-1.2
- cosNotification-1.2
- cosProperty-1.2
- cosTime-1.2
- cosTransactions-1.3
- debugger-4.1.1
- edoc-0.7.17
- eldap-1.2
- et-1.5.1
- gs-1.6
- ic-4.4
- megaco-3.18
- mnesia-4.13.2
- odbc-2.11.1
- orber-3.8
- os_mon-2.4
- ose-1.1
- otp_mibs-1.1
- percept-0.8.11
- reltool-0.7
- syntax_tools-1.7
- webtool-0.9
Conflicts:
OTP_VERSION
erts/vsn.mk
|
|
* rickard/ohmq-fixup/OTP-13047:
Fix check_process_code()
|
|
|
|
* lukas/erts/forker: (28 commits)
erts: Never abort in the forked child
erts: Mend ASSERT makro for erl_child_setup
erts: Allow enomem failures in port_SUITE
erts: iter_port sleep longer on freebsd
erts: Allow one dangling fd if there is a gethost port
erts: Only use forker StackAck on freebsd
erts: It is not possible to exit the forker driver
erts: Add forker StartAck for port start flowcontrol
erts: Fix large open_port arg segfault for win32
erts: Fix memory leak at async open port
kernel: Remove cmd server for unix os:cmd
erts: Add testcase for huge port environment
erts: Move os_pid to port hash to child setup
erts: Handle all EINTR and EAGAIN cases in child setup
erts: Make child_setup work with large environments
erts: Fix forker driver ifdefs for win32
erts: Fix uds socket handling for os x
erts: Fix dereferencing of unaligned integer for sparc
erts: Flatten too long io vectors in uds write
erts: Add fd count test for spawn_driver
...
Conflicts:
erts/emulator/beam/erl_node_tables.c
erts/preloaded/src/erts_internal.erl
|
|
We always want the error to propagate up to the application
when a child cannot be created.
|
|
when called by hash.c for example.
We use ASSERT from sys.h but erl_child_setup implements
its own erl_assert_error() as it doesn't link with sys.o.
|
|
With the new forker implementation also enomem can be returned
as an indicator that it is not possible to create more ports.
|
|
|
|
|
|
|
|
|
|
An acknowledgement of the Start command has to be managed
as we have to make sure that packages are not dropped and
also that the close calls do not happen too early.
|
|
os_SUITE:large_output_command send a 10k large
argument to open_port({spawn,""}) which was too
small for the 2K buffer allocated for win32.
The buffer is now dynamic and any size can be used.
|
|
When an async open port fails early, it would sometimes
leak memory.
|
|
|
|
Had to move the hashing because of a race that can otherwise happen
where a new os_pid value was inserted into the hash before the
previous value had been removed.
Also replaced the protocol inbetween erts and child setup to be
a binary protocol. This was done in order to deal with the varying
size of Eterm.
|
|
|
|
|
|
|
|
OS X is very strict in what it requires of you and also
gives strange error codes for some errors. In this commit
we remap EMSGSIZE to EMFILE and also precisely tune the
amount of data we send on the socket so that we can recv
only that data. If we try to recv more, recvmsg fails with
EPIPE if the remote end has been closed.
|
|
|
|
|
|
|
|
Instead of forking from the beam process, we create a separate
process in which all forks are done. This has several advantages:
1) performance:
* don't have to close all fd's in the world
* fork only has to copy stuff from a small process
* work is done in a completely seperate process
* a 3x performance increase has been measured,
can be made even greater (10x) if we cache the
environment in child setup
2) stability
* the exec is done in another process than beam, which means that
if the file that we exec to is on an nfs that is not available
right now we will not block a scheduler until the nfs returns.
3) simplicity
* don't have to deal with SIGCHLD in the erts
Unfortunately, this solution also implies some badness.
1) There will always be a seperate process running together with
beam on unix. This could be confusing and undesirable.
2) We have to transfer the entire environment to child_setup
for each command.
OTP-13088
|
|
|
|
|
|
|
|
|
|
|
|
OTP-13087
|
|
OTP-13086
|
|
|
|
|
|
* bjorn/deprecate-random/OTP-12502:
Deprecate the 'random' module
Eliminate mentions of 'random' in documentation
mnesia tests: Replace 'random' with 'rand'
percept tests: Replace 'random' with 'rand'
system tests: Replace 'random' with 'rand'
common_test tests: Replace 'random' with 'rand'
gs: Remove the contribs directory
wx: Replace 'random' with 'rand'
stdlib tests: Replace 'random' with 'rand'
kernel test: Replace 'random' with 'rand'
debugger tests: Replace 'random' with 'rand'
compiler tests: Replace 'random' with 'rand'
Emulator test suite: Replace use of 'random' with 'rand'
Use 'rand' instead of the obsolete 'random' module
compile: Eliminate use of the obsolete 'random' module
|
|
|
|
|
|
|
|
|
|
* sverk/setnode-rename-bug/OTP-13076:
erts: Fix correct node name for DTRACE
|
|
broken by 949de78331b9c4ecb9.
|
|
|