summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2020-08-11Changing router to application port exchange protocol.Max Romanov7-97/+342
The application process needs to request the port from the router instead of the latter pushing the port before sending a request to the application. This is required to simplify the communication between the router and the application and to prepare the router to use the application shared port and then the queue.
2020-08-11Adding a reference counter to the libunit port structure.Max Romanov3-357/+346
The goal is to minimize the number of (pid, id) to port hash lookups which require a library mutex lock. The response port is found once per request, while the read port is initialized at startup.
2020-08-11Libunit refactoring: port management.Max Romanov8-336/+379
- Changed the port management callbacks to notifications, which e. g. avoids the need to call the libunit function - Added context and library instance reference counts for a safer resource release - Added the router main port initialization
2020-08-09Fixing leaked configuration objects.Max Romanov1-4/+30
If there are no listen sockets, the router configuration usage counter remains 0 and never decreases. The only moment to release a configuration is right after a configuration update.
2020-08-09Fixing connection remote sockaddr leakage.Max Romanov1-2/+4
Earlier patch 1bf971f83571 fixes connection leakage. But connection free requires separate remote sockaddr release.
2020-08-09Ruby: fixed gem mount paths.Valentin Bartenev1-4/+2
The gem paths must depend on the specified interpreter. Also, gemdir looks redundant as it's already included in Gem.default_path().
2020-08-09Ruby: simplified commands in ./configure script.Valentin Bartenev1-9/+9
There is no reason to use printf instead of just print. No functional changes.
2020-08-09Ruby: removed unused variable from ./configure script.Valentin Bartenev1-1/+0
2020-08-08Configure: verifying the Ruby library path.Valentin Bartenev1-4/+10
An attempt to build a Ruby module for a custom Ruby installation that has the same major version as the system Ruby may unexpectedly cause the use of the system Ruby library. This closes #449 issue on GitHub.
2020-08-07Node.js: correct port data memory release.Max Romanov1-1/+15
According to libuv documentation, uv_poll_t memory should be released in a callback function passed to uv_close(). Otherwise, the Node.js application process may crash at exit.
2020-08-07Fixing listen event connection leakage.Max Romanov1-0/+4
A connection object is allocated in advance for each listen event object to be used for the established connection. This connection needs to be freed when the listen event is destroyed.
2020-08-05Improved mkstemp() error reporting.Valentin Bartenev1-1/+1
The invocation parameters should be logged as well, notably the path of the file that is failed to be created. Also, log level changed to ALERT as it's quite critical error.
2020-08-05Fixed nxt_conn_accept_alloc() behavior in low memory conditions.Valentin Bartenev1-5/+5
Earlier, if nxt_mp_create() failed to allocate memory while accepting a new connection, the resulting NULL was subsequently passed to nxt_mp_destroy(), crashing the process. More, if nxt_mp_create() was successful but nxt_sockaddr_cache_alloc() failed, the connection object wasn't destroyed properly, leaving the connection counter in an inconsistent state. Repeated, this condition lowered the connection capacity of the process and could eventually prevent it from accepting connections altogether.
2020-07-31Isolation: fixed the generation of mounts table.Tiago Natel de Moura6-23/+28
Since the introduction of rootfs feature, some language modules can't be configured multiple times. Now the configure generates a separate nxt_<module>_mounts.h for each module compiled.
2020-07-28PHP: fixed version comparison in configure script.Tiago Natel de Moura1-2/+2
Some PPAs for Ubuntu package PHP with versions like: 7.2.28-3+ubuntu18.04.1+deb.sury.org+1 But the script expected only "X.Y.Z". The issue was introduced in: http://hg.nginx.org/unit/rev/2ecb15904ba5
2020-07-28Configuration: fixed buffer over-read in pattern validation.Axel Duch1-2/+3
There was an undefined behavior in the validation function, caused by testing one character after the string if a wildcard was at the end.
2020-07-28Tests: added PHP test with time check in error log messages.Andrei Zeliankou2-0/+29
2020-07-28Tests: fixed double stop() call for some tests.Andrei Zeliankou1-6/+11
2020-07-28Tests: style.Andrei Zeliankou4-7/+5
2020-07-25Using plain shared memory for configuration pass.Max Romanov4-83/+152
There is no restrictions on configration size and using segmented shared memory only doubles memory usage because to parse configration on router side, it needs to be 'plain' e. g. located in single continous memory buffer.
2020-07-24Configuration: added checking for presence of mandatory fields.Valentin Bartenev3-13/+131
2020-07-24Added missing ending indicator in object members validation lists.Valentin Bartenev1-1/+5
This fixes undefined behaviour due to array over-read if an unknown parameter is specified in an uidmap, a gidmap, or a php target object.
2020-07-24Configuration: removing redundant check.Axel Duch1-3/+3
Thanks to 洪志道 (Hong Zhi Dao).
2020-07-24Minor changes and renaming an NJS artifact to NXT.Axel Duch1-3/+3
This is partially related to #434 issue on Github. Thanks to 洪志道 (Hong Zhi Dao).
2020-07-23Fixing request_app_link reference counting.Max Romanov1-4/+2
Racing conditions reproduced periodically on test_python_process_switch.
2020-07-23Fixing various router crashes on exit caused by runtime pool free.Max Romanov1-7/+18
Currently, the router exits without waiting for the worker threads to stop. There is a short gap between the runtime memory pool's free and the exit, during which a worker thread may try to access a runtime structure. In turn, this may cause a crash. For now, it is better to keep this memory allocated.
2020-07-23PHP: using nxt_unit_default_init() for module structure init.Max Romanov1-32/+4
Using this function in all language modules helps to avoid code duplication and reduce the size of future patches.
2020-07-23Fixing main and application port structs file descriptor init.Max Romanov1-0/+2
Correct value for non-initialized file descriptor is -1, because most of the checks in libunit compares file descriptor with -1 before performing an action. Using 0 as default value, may cause to close file descriptor #0, this may affect application logic. It is not required to list this patch in changelog because impact is not seen by end users.
2020-07-23PHP: removing assertion to fix build on macOS.Max Romanov1-1/+5
The nxt_assert macro uses nxt_thread_context, which caused the following linker error when using it in the library: ld: illegal thread local variable reference to regular symbol _nxt_thread_context for architecture x86_64
2020-07-22Tests: switching stdout to blocking before printing log.Max Romanov1-3/+6
This is another attempt to fix the following error message: BlockingIOError: [Errno 11] write could not complete without blocking
2020-07-22Fixing buffer overflow check in discovery.Max Romanov1-1/+1
Incorrect check prevents Unit to start without modules. This issue was introduced in 4a3ec07f4b19.
2020-07-21PHP: logging in request context when possible.Valentin Bartenev1-2/+12
2020-07-21PHP: fixed incorrect time in interpreter error log messages.Valentin Bartenev1-5/+6
Previously, the log message callback used a generic log function, that relied on the process time cache. Since there were no time update calls in the application processes, all log lines were printed with the same time, usually correlated with the process start. Now, a non-cached logging function from libunit is used.
2020-07-21Fixed non-debug log time format in libunit.Valentin Bartenev1-0/+7
This makes log format used in libunit consistent with the daemon, where milliseconds are printed only in the debug log level. Currently a compile time switch is used, since there's no support for runtime changing of a log level for now. But in the future this should be a runtime condition, similar to nxt_log_time_handler().
2020-07-13Docker: run entrypoint scripts for unitd-debug as well.Konstantin Pavlov1-1/+1
2020-07-10Router: route patterns multi wildcards fix.Axel Duch2-3/+27
Matching 'start' and 'end' position now adjusted to avoid false matching. This is related to #434 issue on Github. Thanks to 洪志道 (Hong Zhi Dao).
2020-07-06Destroying temporary router configuration.Igor Sysoev2-34/+40
The lifespan of a listening socket is longer than both router configuration's and temporary router configuration's lifespan, so the sockets should be stored in persistent queues. Safety is ensured by the fact that the router processes only one new configuration at any time.
2020-07-04Router: route patterns multi wildcards support.Axel Duch3-157/+254
2020-06-26Tests: fixed opcache detection.Andrei Zeliankou1-1/+2
opcache_get_status() returns array, so square brackets should be used to access "opcache_enabled" value.
2020-06-24Tests: added chunked tests.Andrei Zeliankou1-0/+249
2020-06-23Upstream chunked transfer encoding support.Igor Sysoev7-98/+179
2020-06-23Decreased level of some socket close() errors.Igor Sysoev2-13/+36
2020-06-23Isolation: fixed build when features aren't detected.Tiago Natel de Moura5-129/+116
2020-06-23Python: fixed interpreter path in ./configure.Tiago Natel de Moura1-2/+1
2020-06-16Packages: added Fedora 32 support.Andrei Belov3-1/+79
2020-06-08Version bump.Valentin Bartenev1-2/+2
2020-05-28Adjusted tag 1.18.0 to include 9e14c63773be.Valentin Bartenev1-1/+1
2020-05-28Packages: fixed java configure script.1.18.0Tiago Natel de Moura4-5/+5
Now the configure script appends /server to --lib-path argument.
2020-05-28Added tag 1.18.0 for changeset a34bc498d976Valentin Bartenev1-0/+1
2020-05-28Generated Dockerfiles for Unit 1.18.0.Valentin Bartenev8-8/+8