Commit Graph

822 Commits

Author SHA1 Message Date
Valentin Bartenev
fd99a738e5 Added tag 1.5 for changeset b3dee0cc5a4e 2018-10-25 18:55:39 +03:00
Valentin Bartenev
a1abebd5b9 Generated Dockerfiles for Unit 1.5. 2018-10-25 17:49:10 +03:00
Valentin Bartenev
d55282105a Packages: updated to 1.5-1. 2018-10-25 17:49:10 +03:00
Valentin Bartenev
a04554118c Added version 1.5 CHANGES. 2018-10-25 17:48:56 +03:00
Alexander Borisov
5b3d3e0a88 Node.js: additional type check for response.setHeader value. 2018-10-24 16:21:53 +03:00
Valentin Bartenev
6cc4080af2 Removed unused "--upstream" command line option. 2018-10-23 18:55:16 +03:00
Igor Sysoev
d4a99aad84 Backout of ba94959b1dec and improving epoll error handling. 2018-10-23 16:31:42 +03:00
Alexander Borisov
7801814126 Added ability to publish Node.js module. 2018-10-23 13:06:44 +03:00
Andrei Belov
0e76769c1b Packages: introduced unit-dev/unit-devel package. 2018-10-23 10:30:28 +03:00
Igor Sysoev
57991dc3f2 Fixed termination signal handlers in worker processes.
This closes #99 issue on GitHub.
Thanks to Julian Brost.
2018-10-22 17:43:31 +03:00
Igor Sysoev
50dd54877d Improved epoll failures handling.
epoll changes are committed to the kernel before epoll_wait() or
on changes array overflow.  In the latter case if there are errors
epoll_wait() timeout was not set to zero.

This commit is related to #173 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-22 17:43:28 +03:00
Igor Sysoev
deeb276d23 Removed duplicate code in epoll.
This commit is related to #173 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-22 16:25:58 +03:00
Valentin Bartenev
da0ef366dc Handling of timers with bias.
Timers that don't require maximum precision (most of them, actually) can be
triggered earlier or later within the bias interval.

To reduce wakeups by timers, the expire function now triggers not only all
timers that fall within the elapsed time, but also those whose bias falls
within this interval.
2018-10-22 16:04:16 +03:00
Valentin Bartenev
b20e995e80 Timers: separation of delete and insert operations on rbtree.
Delete/insert operation complexity for a red-black tree is O(log n),
where n is the total number of tree elements.

If all delete operations are performed before all insert operations,
the average number of tree elements during an operation will be
lower than in the mixed-operations case.
2018-10-22 16:02:14 +03:00
Valentin Bartenev
a4aaf90679 Re-engineered timers.
To optimize rbtree operations, all changes are stored in array and later
processed in batches.

The previous implementation of this mechanics had a number of design flaws.
Each change was saved in a new array entry; until the changes were applied,
the timer remained in an intermediate state (NXT_TIMER_CHANGING).
This intermediate state didn't allow to identify if time was going to be
disabled or enabled.  However, the nxt_conn_io_read() function relied on
this information; as a result, in some cases the read timeout wasn't set.

Also, the nxt_timer_delete() function did not reliably track whether a timer
was added to the work queue.  It checked the NXT_TIMER_ENQUEUED state of
a timer, but this state could be reset to NXT_TIMER_DISABLED by a
nxt_timer_disable() call or another nxt_timer_delete() call.

Now, instead of keeping the whole history of the timer's changes, the new
implementation updates the timer state immediately, and only one operation
is added to the array to add or delete timer in the rbtree according
to its final state.
2018-10-22 16:01:10 +03:00
Sergey Kandaurov
161e1839a5 Compatibility with LibreSSL.
LibreSSL uses high OPENSSL_VERSION_NUMBER, but has no SSL_CTX_add0_chain_cert().
2018-10-22 16:16:05 +03:00
Sergey Kandaurov
3061e8333d Tests: provide openssl.conf in test_tls_certificate_key_ec.
Previously, test failed if openssl was unable to load config info,
or the system's openssl.cnf was picked up, which is wrong as well.
2018-10-18 18:46:21 +03:00
Alexander Borisov
0ee8de5543 Fixed Makefile target for NodeJS. 2018-10-18 13:38:30 +03:00
Max Romanov
49ec17b1ef Installing libunit headers and static library. 2018-10-17 15:52:44 +03:00
Valentin Bartenev
029c1a9f50 Renamed "go" application type to "external".
There's nothing specific to Go language.  This type of application object can
be used to run any external application that utilizes libunit API.
2018-10-09 17:53:31 +03:00
Andrei Belov
6c5e5f25ef Packages: all CRLF newlines in examples converted to LF. 2018-10-05 14:10:13 +03:00
Alexander Borisov
ea62327b00 Added Node.js support. 2018-10-03 17:50:03 +03:00
Max Romanov
141ee2aa32 Filling cmsghdr with 0 to pass Go 1.11 message validation. 2018-10-02 19:49:49 +03:00
Max Romanov
c8b30ef4da Go: fixing typo in log messages. 2018-10-02 19:49:48 +03:00
Max Romanov
cb1b074493 Making port fd blocking on app side and non-blocking in Unit.
This issue was introduced in libunit commit (e0f0cd7d244a).  All port
sockets in application should be in blocking mode whereas Unit itself
operates non-blocking sockets.

Having non-blocking sockets in application may cause send error during
intensive response packets generation.

See https://mailman.nginx.org/pipermail/unit/2018-October/000080.html.
2018-10-02 19:46:06 +03:00
Valentin Bartenev
d54d806c52 Disabled chunked transfer encoding for 304 responses as well.
According to RFC 7232:

 | A 304 response cannot contain a message-body; it is always terminated
 | by the first empty line after the header fields.
2018-10-01 15:06:31 +03:00
Valentin Bartenev
3c2eddb183 Allowing keep-alive connections after 204 responses.
This was unintentionally disabled by 7b5026a0bdeb.
2018-10-01 15:06:31 +03:00
Valentin Bartenev
e51ab1b2cb Fixed error log time caching resolution.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-01 15:06:31 +03:00
Valentin Bartenev
db1e01d992 Mention of --openssl configure option in help.
This closes #171 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-01 15:06:31 +03:00
Andrei Belov
02a4dd7c78 Skipping minor entries while producing generic CHANGES.
Currently we consider any changes with revision other than 1 as
packages-specific, thus there is no need to include such entries
to the generic Unit change log.
2018-10-01 09:41:03 +03:00
Igor Sysoev
b5d4fc939e Disabled chunked transfer encoding for 204 responses. 2018-09-28 17:32:02 +03:00
Igor Sysoev
92da8dae1e Fixed bug in socket write error handling.
The bug has been introduced in e3972a4a9c73.
2018-09-28 15:12:47 +03:00
Valentin Bartenev
425d560372 Version bump. 2018-09-28 15:05:35 +03:00
Andrei Belov
2a9fc6b1fe Packages: updated to 1.4-2. 2018-09-27 15:05:03 +03:00
Andrei Belov
aa6e4947ba Packages: adjusted post-install banners. 2018-09-27 15:04:49 +03:00
Andrei Belov
446479b311 Packages: removed "loadconfig" and "saveconfig" actions. 2018-09-26 15:24:49 +03:00
Valentin Bartenev
6b8a992bfa Added tag 1.4 for changeset 8f4524a9cf87 2018-09-20 18:20:41 +03:00
Valentin Bartenev
80217caa52 Generated Dockerfiles for Unit 1.4. 2018-09-20 18:19:14 +03:00
Valentin Bartenev
63ff7a341a Added version 1.4 CHANGES. 2018-09-20 18:18:52 +03:00
Max Romanov
58c38298f5 Resetting init->stream for ready process.
Router requests application start by sending port message with application
parameters to master.  In response router gets application port.  Stream id
used to link request and response.  If application process terminates
unexpectedly (e.g. before ready state), it is required to notify router about
application start failure.  For this purpose stream id is stored in process
initialization parameters.

Stream id sequentially incremented and starts from 1 in case of router
resurrection.  New router application start stream id may coincide with
stream id of currently running/terminating application processes.  In such
cases router may receive REMOVE_PID message with same stream id as used in
application start request and mistakenly reports application start failure.

This commit tries to avoid such errors by resetting stream for processes in
ready state.
2018-09-20 17:30:56 +03:00
Andrey Zelenkov
d0e428aace Tests: TLS tests. 2018-09-20 16:34:34 +03:00
Sergey Kandaurov
e4650b7412 Fixed building perl on Alpine Linux.
_GNU_SOURCE is required there to expose off64_t and other types.
2018-09-20 16:34:19 +03:00
Max Romanov
9fe6e75d35 Preventing port from release in asynchronous operations.
Router reconfiguration may lead to starting new application processes, opening
listen ports etc.  These actions are asynchronous and require message
exchange with master process.  Router stores reference for controller
(response) port in structure associated with reconfiguration process (tmcf).
The port used to provide reconfiguration response (either success or failed)
to controller.

This commit increases response port use counter to make sure port structure
not freed while router waits for result of asynchronous operations.
2018-09-20 16:16:32 +03:00
Andrei Belov
fea05e3065 Packages: enabled OpenSSL support. 2018-09-20 16:14:29 +03:00
Valentin Bartenev
510c2e15c5 Python: adjusted input.read(size) argument value interpretation.
Previously, passing 0 resulted in reading the whole body and all negative
values raised an exception.

Now the behaviour is in consistentance with io.RawIOBase.read() interface,
and passing 0 returns empty (byte) string, while -1 results in reading the
whole body.
2018-09-20 16:04:49 +03:00
Max Romanov
9f29ac9f3e Preserving inherited engine memory pool in controller process.
The pool is inherited from master process since changeset 854a1a440616.
2018-09-20 15:50:48 +03:00
Valentin Bartenev
a2eca97e89 Controller: addressing of array elements in requests. 2018-09-20 15:27:14 +03:00
Valentin Bartenev
8d844bc2aa Controller: certificates storage interface. 2018-09-20 15:27:08 +03:00
Valentin Bartenev
2dfd8ffc2f Deduplicated string value initializations. 2018-09-20 15:27:06 +03:00
Igor Sysoev
b5d76454ed Added nginx error 497 response. 2018-09-20 15:05:38 +03:00