summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2019-12-26Merged with the default branch.1.14.0-1Andrei Belov128-3265/+5182
2019-12-26Added tag 1.14.0 for changeset 6e28966ed1f2Valentin Bartenev1-0/+1
2019-12-26Generated Dockerfiles for Unit 1.14.0.1.14.0Valentin Bartenev8-8/+8
2019-12-26Added version 1.14.0 CHANGES.Valentin Bartenev2-0/+75
2019-12-25Go: changing import name for "unit.nginx.org/go".Max Romanov14-15/+15
This patch includes packaging changes - update unit-go installation directory.
2019-12-16Using the 64-bit Linux capability mode when available.Tiago Natel de Moura1-1/+11
For backward compatibility, the Linux capabilities macros exposes v1 semantics (32-bit) by default. We probe the version at runtime (because of pre-compiled binaries) but the kernel syscall API is conservative and it doesn't return a 64-bit capability version if the input version is v1. This patch suppress the kernel > 5.0 dmesg log below: capability: warning: 'unitd' uses 32-bit capabilities (legacy support in use)
2019-12-24Tests: routing by listener address.Axel Duch1-0/+58
2019-12-24Router: introducing routing on listener address.Axel Duch2-4/+36
2019-12-24Tests: routing by client address configuration.Axel Duch1-0/+353
2019-12-24Router: introducing routing on client address.Axel Duch6-4/+734
2019-12-24Go: introducing SHM_ACK observer.Max Romanov3-11/+77
Each request processed in a separate goroutine. In case of OOSM state, during response write, request goroutine blocks on channel which waits event from main thread about SHM_ACK message from router.
2019-12-24Node.js: implementing output message drain using SHM_ACK feature.Max Romanov3-26/+188
ServerResponse.write() method tries to write data buffer using libunit and stores buffers to write in a Server-wide output queue, which is processed in response to SHM_ACK message from router. As a side effect 'drain' event implemented and socket.writable flag reflect current state.
2019-12-24Introducing port messages to notify about out of shared memory.Max Romanov6-68/+567
- OOSM (out of shared memory). Sent by application process to router when application reaches the limit of allocated shared memory and needs more. - SHM_ACK. Sent by router to application when the application's shared memory is released and the OOSM flag is enabled for the segment. This implements blocking mode (the library waits for SHM_ACK in case of out of shared memory condition and retries allocating the required memory amount) and non-blocking mode (the library notifies the application that it's out of shared memory and returns control to the application module that sets up the output queue and puts SHM_ACK in the main message loop).
2019-12-24Adding "limits/shm" configuration validation and parsing.Max Romanov11-11/+67
2019-12-24Renaming nxt_unit_mmap_buf_remove to nxt_unit_mmap_buf_unlink.Max Romanov1-7/+7
The function unchains the buffer from the buffer's linked list.
2019-12-24Introducing write tail reference to avoid buffer chain iteration.Max Romanov2-4/+17
2019-12-24Using non-shared memory buffers for small messages.Max Romanov1-101/+203
Current shared memory buffer implementation uses fixed-size memory blocks, allocating at least 16384 bytes. When application sends data in a large number of small chunks, it makes sense to buffer them or use plain memory buffers to improve performance and reduce memory footprint. This patch introduces minimum size limit (1024 bytes) for shared memory buffers.
2019-12-24Go: moving source files to the root of the project.Max Romanov14-3/+6
This patch includes packaging changes related to files move.
2019-12-24Go: installing go module for tests into build directory.Max Romanov2-2/+2
2019-12-24Packages: making unit-go architecture independent.Max Romanov19-457/+17
To support Go modules, the unit-go module should be platform independent. All platform-dependent logic is moved to libunit, so the unit-dev package should be installed before building unit-go.
2019-12-24Go: linking against libunit.Max Romanov2-12/+30
2019-12-24Removed unused variables from "docs/Makefile".Valentin Bartenev1-3/+1
They actually have been broken since 00d8049418cf, where NXT_VERSION was removed from nxt_main.h. Also, shebang is added.
2019-12-23Python: pre-creation of objects for string constants.Valentin Bartenev1-38/+156
This is an optimization to avoid creating them at runtime on each request.
2019-12-10Packages: added Python 3 support on Amazon Linux 2 (LTS).Andrei Belov3-4/+5
2019-12-09Java: fixing racing condition in external JAR download.Max Romanov1-3/+6
Temporary file name with configure process PID used to download JAR from external repository. Then file renamed using command 'mv'. The issue reproduced in clean environment when 2 or more concurrent builds started.
2019-12-09Tests: routing tests refactored.Andrei Zeliankou2-1774/+331
2019-12-06Tests: added privileged credential tests.Tiago Natel1-44/+150
2019-12-06Isolation: allowed the use of credentials with unpriv userns.Tiago Natel13-135/+1170
The setuid/setgid syscalls requires root capabilities but if the kernel supports unprivileged user namespace then the child process has the full set of capabilities in the new namespace, then we can allow setting "user" and "group" in such cases (this is a common security use case). Tests were added to ensure user gets meaningful error messages for uid/gid mapping misconfigurations.
2019-12-06Moved credential-related code to nxt_credential.c.Tiago Natel9-353/+378
This is required to avoid include cycles, as some nxt_clone_* functions depend on the credential structures, but nxt_process depends on clone structures.
2019-12-02Merged with the default branch.Andrei Belov10-1/+247
2019-11-21Packages: added Ubuntu 19.10 "eoan" support.Andrei Belov8-1/+168
2019-11-19Packages: added Python 3.8 on Ubuntu 18.04, 19.04.Andrei Belov5-0/+79
2019-11-14Added tag 1.13.0-1 for changeset 439bd957eeb4Andrei Belov1-0/+1
2019-11-14Merged with the default branch.1.13.0-1Andrei Belov86-720/+3555
2019-11-14Added tag 1.13.0 for changeset 3313bf222e6eValentin Bartenev1-0/+1
2019-11-14Generated Dockerfiles for Unit 1.13.0.1.13.0Valentin Bartenev9-9/+9
2019-11-14Added version 1.13.0 CHANGES.Valentin Bartenev2-0/+90
2019-11-14Tests: Python exception tests.Andrei Zeliankou2-0/+202
2019-11-14Python: avoiding buffering of exception backtraces.Valentin Bartenev1-7/+47
A quote from the Python 3 documentation: | When interactive, stdout and stderr streams are line-buffered. | Otherwise, they are block-buffered like regular text files. As a result, if an exception occurred and PyErr_Print() was called, its output could be buffered but not printed to the log for a while (ultimately, until the interpreter finalization). If the application process crashed shortly, the backtrace was completely lost. Buffering can be disabled by redefining the sys.stderr stream object. However, interference with standard environment objects was deemed undesirable. Instead, sys.stderr.flush() is called every time after printing exceptions. A potential advantage here is that lines from backtraces won't be mixed with other lines in the log.
2019-11-14Python: removed wrong PyErr_Print() call.Valentin Bartenev1-1/+0
PyCallable_Check() doesn't produce errors. The needless call was introduced in fdd6ed28e3b9.
2019-11-14Python: optimized response object close() calling.Valentin Bartenev1-7/+14
PyObject_HasAttrString() is just a wrapper over PyObject_GetAttrString(), while PyObject_CallMethod() calls it as the first step. As a result, PyObject_GetAttrString() was called twice if close() was present. To get rid of PyObject_HasAttrString() while keeping the same behaviour, the PyObject_CallMethod() call has been decomposed into separate calls of PyObject_GetAttrString() and PyObject_CallFunction().
2019-11-14Python: fixed an object leak when response close() is called.Valentin Bartenev1-10/+19
On success, PyObject_CallMethod() returns a new reference to the result of the call, which previously got lost. Also, error logging on failure was added. The issue was introduced by b0148ec28c4d.
2019-11-14Python: refactored nxt_python_request_handler().Valentin Bartenev1-56/+31
2019-11-14Python: fixed potential object leak in case of allocation error.Valentin Bartenev1-0/+2
2019-11-14Python: improved error handling if response object isn't iterable.Valentin Bartenev1-0/+1
According to the documentation, PyObject_GetIter(): | Raises TypeError and returns NULL if the object cannot be iterated. Previously, this exception wasn't printed or cleared and remained unhandled.
2019-11-14Python: fixed handling of errors on response object iteration.Valentin Bartenev1-8/+15
According to the documentation, PyIter_Next(): | If there are no remaining values, returns NULL with no exception set. | If an error occurs while retrieving the item, returns NULL and passes | along the exception. Previously, this exception wasn't properly handled and the response was finalized as successful. This issue was introduced in b0148ec28c4d. A check for PyErr_Occurred() located in the code below might print this traceback or occasionally catch an exception from one of the two response close() calls. Albeit that exceptions from the close() calls also need to be catched, it's clear that this particular check wasn't supposed to do so. This is another issue and it will be fixed later.
2019-11-14Tests: proxy tests.Andrei Zeliankou2-0/+647
2019-11-14Tests: run_process() and stop_processes() introduced.Andrei Zeliankou1-0/+22
2019-11-14Tests: waitforsocket() introduced.Andrei Zeliankou1-0/+18
2019-11-14Processing inconsistent proxied response length.Igor Sysoev4-3/+32
Keepalive connection is disabled if upstream response length differs from specified in the "Content-Length" field value.