Age | Commit message (Collapse) | Author |
|
* lukas/erts/sendfile_no_async_pool/OTP-11639:
erts/kernel: sendfile no longer uses async threads
|
|
* lukas/erts/sendfile_passive_mode_fix/OTP-11614:
erts: fix bug when using passive mode and sendfile
|
|
The bug incorrectly issued driver_select when un-ignoring an fd
for a socket in passive mode, which caused an incorrect error
tuple to be returned when the remote end closed the connection.
|
|
This has been done because a slow client attack is possible if the
async thread pool is used. The scenario is:
Client does a request for a file and then slowly receives the file one
byte at a time. This will eventually fill the async thread pool with blocking
sendfile operations and thus starving the vm of all file operations.
If you still want to use the async threads pool for sendfile an option to
enable it has been introduced.
|
|
gzio.c is our own replacement for zlib's gzopen() etc
(based on a version of gzio.c that was included in an old version
of zlib).
Unfortunately, gzio.c still depends on the *internal* zlib header file
zutil.h which is not supposed to be used outside of the zlib source
code. The dependencies are the use of the gzFile typedef and the
F_OPEN() macro.
Instead of gzFile, define and use our own ErtsGzFile.
To get rid of the F_OPEN() macro, call open() of _wfopen() directly.
|
|
|
|
* sv/file-osync/OTP-11498:
Add sync option to file:open/2
Conflicts:
erts/preloaded/ebin/prim_file.beam
|
|
Conflicts:
erts/preloaded/ebin/prim_inet.beam
lib/kernel/test/gen_sctp_SUITE.erl
|
|
|
|
|
|
The sync option adds the POSIX O_SYNC flag to the open system call on
platforms that support the flag or its equivalent, e.g.,
FILE_FLAG_WRITE_THROUGH on Windows. For platforms that don't support it,
file:open/2 returns {error, enotsup} if the sync option is passed in.
The semantics of O_SYNC are platform-specific. For example, not all
platforms guarantee that all file metadata are written to the disk along
with the file data when the flag is in effect. This issue is noted in the
documentation this commit adds for the sync option.
Add a test for the sync option. Note however that the underlying OS
semantics for O_SYNC can't be tested automatically in any practical way, so
the test assumes the OS does the right thing with the flag when
present. For manual verification, dtruss on OS X and strace on Linux were
both run against beam processes to watch calls to open(), and file:open/2
was called in Erlang shells to open files for writing, both with and
without the sync option. Both the dtruss output and the strace output
showed that the O_SYNC flag was present in the open() calls when sync was
specified and was clear when sync was not specified.
|
|
|
|
|
|
Conflicts:
erts/preloaded/ebin/erlang.beam
|
|
Introduce unconditional ERTS_ASSERT
and use that for both ASSERT and ASSERT_EXPR.
|
|
Add the {active,N} socket option, where N is an integer in the range
-32768..32767, to allow a caller to specify the number of data messages to
be delivered to the controlling process. Once the socket's delivered
message count either reaches 0 or is explicitly set to 0 with
inet:setopts/2 or by including {active,0} as an option when the socket is
created, the socket transitions to passive ({active, false}) mode and the
socket's controlling process receives a message to inform it of the
transition. TCP sockets receive {tcp_passive,Socket}, UDP sockets receive
{udp_passive,Socket} and SCTP sockets receive {sctp_passive,Socket}.
The socket's delivered message counter defaults to 0, but it can be set
using {active,N} via any gen_tcp, gen_udp, or gen_sctp function that takes
socket options as arguments, or via inet:setopts/2. New N values are added
to the socket's current counter value, and negative numbers can be used to
reduce the counter value. Specifying a number that would cause the socket's
counter value to go above 32767 causes an einval error. If a negative
number is specified such that the counter value would become negative, the
socket's counter value is set to 0 and the socket transitions to passive
mode. If the counter value is already 0 and inet:setopts(Socket,
[{active,0}]) is specified, the counter value remains at 0 but the
appropriate passive mode transition message is generated for the socket.
This commit contains a modified preloaded prim_inet.beam due to changes in
prim_inet.erl.
Add tests for {active,N} mode for TCP, UDP, and SCTP sockets.
Add documentation for {active,N} mode for inet, gen_tcp, gen_udp, and
gen_sctp.
|
|
* raimo/fix-signedness-flaws-in-efile_drv:
Fix EV_* macros and functions signedness flaws
|
|
* raimo/linux-network-namespace-sockopt/OTP-11157:
Document socket option 'netns'
Rudimentary test
Make netns option value a string
Implement netns for SCTP + bugfixes
Implement netns option for TCP and UDP
Implement emulator netns support for TCP and UDP
|
|
|
|
The actual port id is used to create a key from the
pointer value which is the ErlDrvPort. To do this
a new driver api function driver_async_port_key is
added and the driver API minor version is updated.
The documentation is updated and the faulty description of
how to spread ports over async threads is updated to
use the new API.
Testcase also added.
|
|
|
|
|
|
This is needed as some gcc versions seems to optimize this undefined
behaviour in a way which breaks this code.
|
|
|
|
|
|
|
|
Bug introduced in a73414d2e8ad03538 and never released.
|
|
* rickard/inet_opts/OTP-11075:
Make high_msgq_watermark and low_msgq_watermark generic inet options
Conflicts:
erts/preloaded/ebin/prim_inet.beam
|
|
|
|
* lukas/erts/efile_delayed_write_fix/OTP-10984:
Do driver_deq in worker threads instead of async_ready
|
|
Doing it in async_ready was needed before the pdl was introduced, but
now with the pdl the deq no longer needs the port lock to protect it.
This was not an issue when async_ready was called in the worker thread,
but now (R15B) that it is signalled back to the scheduler, some very nasty
race conditions could occur when using driver_timer and async jobs.
|
|
|
|
|
|
|
|
* egil/win-efile-bugfix/OTP-10890:
erts: Use correct type for ReadFile bytes read
|
|
|
|
Using a 64bit type for bytes read will not always clear the higher bits.
|
|
* sverk/tcp-exit_on_close-false:
inet_drv: Fix condition to reject INET_REQ_IGNOREFD for UDP and SCTP
A stab at fixing bug with {exit_on_close,false} not working
|
|
|
|
Seems to happen with async threads and when user closes
the file explicitly before the port is closed.
|
|
|
|
when invalid packets are received.
|
|
* pan/fix-compiler-warnings-clang-and-new-gcc:
Fix compiler warnings from GCC 4.7.1 on ARCH Linux
Fix clang compiler warnings on FreeBSD in erts
|
|
|
|
The following are deliberately left, as I have only a list of compiler
warnings and no system to test on:
hipe/hipe_x86_signal.c:264:5: warning: no previous prototype for function '_sigaction' [-Wmissing-prototypes]
int __SIGACTION(int signum, const struct sigaction *act, struct sigaction *oldact)
^
hipe/hipe_x86_signal.c:222:21: note: expanded from macro '__SIGACTION'
^
1 warning generated.
sys/unix/sys_float.c:835:16: warning: declaration of 'struct exception' will not be visible outside of this function [-Wvisibility]
matherr(struct exception *exc)
^
sys/unix/sys_float.c:835:1: warning: no previous prototype for function 'matherr' [-Wmissing-prototypes]
matherr(struct exception *exc)
^
2 warnings generated.
drivers/unix/unix_efile.c:1504:11: warning: implicit declaration of function 'sendfile' [-Wimplicit-function-declaration]
retval = sendfile(in_fd, out_fd, *offset, SENDFILE_CHUNK_SIZE,
^
1 warning generated.
|
|
Also, on 64 bit architectures, use 64 bit int's for the
counters and be specific about the counter variables sizes
utilizing datatypes from sys.h.
|
|
|
|
* pan/R16/redhat_workaround:
Clean up and make the fix work on windows.
Add workaround for CentOS/RedHat writev bug to inet_drv
OTP-10747
|
|
|
|
* fdm/file-allocate/OTP-10680:
Update preloaded prim_file.beam
erts: Fix xcomp configure for fallocate
Add file:allocate/3 operation
|