History log of /unit/src/nxt_controller.c (Results 1 – 25 of 80)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2145:ee1e319c8ed8 24-Apr-2022 Timo Stark

Increased readtimeout for configuration endpoint.

Closes: <https://github.com/nginx/unit/issues/676>


Revision tags: 1.27.0-1, 1.27.0, 1.26.1-1, 1.26.1, 1.26.0-1, 1.26.0
# 1969:be6409cdb028 09-Oct-2021 Zhidao HONG

Configuration: automatic migration to the new "share" behavior.


Revision tags: 1.25.0-1, 1.25.0
# 1926:6e85d6c0b8bb 29-Jul-2021 Max Romanov

Application restart introduced.

When processing a restart request, the router sends a QUIT message to all
existing processes of the application. Then, a new shared application port is
created to en

Application restart introduced.

When processing a restart request, the router sends a QUIT message to all
existing processes of the application. Then, a new shared application port is
created to ensure that new requests won't be handled by the old processes of
the application.

show more ...


Revision tags: 1.24.0-1, 1.24.0, 1.23.0-1, 1.23.0, 1.22.0-1, 1.22.0
# 1787:db82aa07015c 03-Feb-2021 Max Romanov

Using shared memory to pass configuration to main process.

This patch is required to remove fragmented messages functionality.


Revision tags: 1.21.0-1, 1.21.0, 1.20.0-1, 1.20.0, 1.19.0-1, 1.19.0
# 1558:026e4b909b61 11-Aug-2020 Max Romanov

Style fixes for 2 file descriptors transfer over port.

Two consecutive fd and fd2 fields replaced with array.


# 1526:5c2a0b6f92e7 25-Jul-2020 Max Romanov

Using plain shared memory for configuration pass.

There is no restrictions on configration size and using segmented shared memory
only doubles memory usage because to parse configration on router si

Using plain shared memory for configuration pass.

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.

show more ...


Revision tags: 1.18.0-1, 1.18.0
# 1488:6976d36be926 09-Mar-2020 Tiago Natel de Moura

Refactor of process management.

The process abstraction has changed to:

setup(task, process)
start(task, process_data)
prefork(task, process, mp)

The prefork() occurs in the main process rig

Refactor of process management.

The process abstraction has changed to:

setup(task, process)
start(task, process_data)
prefork(task, process, mp)

The prefork() occurs in the main process right before fork.

The file src/nxt_main_process.c is completely free of process
specific logic.

The creation of a process now supports a PROCESS_CREATED state. The
The setup() function of each process can set its state to either
created or ready. If created, a MSG_PROCESS_CREATED is sent to main
process, where external setup can be done (required for rootfs under
container).

The core processes (discovery, controller and router) doesn't need
external setup, then they all proceeds to their start() function
straight away.

In the case of applications, the load of the module happens at the
process setup() time and The module's init() function has changed
to be the start() of the process.

The module API has changed to:

setup(task, process, conf)
start(task, data)

As a direct benefit of the PROCESS_CREATED message, the clone(2) of
processes using pid namespaces now doesn't need to create a pipe
to make the child block until parent setup uid/gid mappings nor it
needs to receive the child pid.

show more ...


# 1470:3c4dc635802a 12-May-2020 Max Romanov

Waiting for router instead of reporting to user on config update.


# 1469:c3249848ee2a 12-May-2020 Max Romanov

Blocking config change when applying the initial router config.


Revision tags: 1.17.0-1, 1.17.0
# 1459:358b957ca294 16-Apr-2020 Max Romanov

Using malloc/free for the http fields hash.

This is required due to lack of a graceful shutdown: there is a small gap
between the runtime's memory pool release and router process's exit. Thus, a
wor

Using malloc/free for the http fields hash.

This is required due to lack of a graceful shutdown: there is a small gap
between the runtime's memory pool release and router process's exit. Thus, a
worker thread may start processing a request between these two operations,
which may result in an http fields hash access and subsequent crash.

To simplify issue reproduction, it makes sense to add a 2 sec sleep before
exit() in nxt_runtime_exit().

show more ...


# 1451:0a8840921fd0 08-Apr-2020 Valentin Bartenev

Controller: improved handling of unix domain control socket.

One of the ways to detect Unit's startup and subsequent readiness to accept
commands relies on waiting for the control socket file to be

Controller: improved handling of unix domain control socket.

One of the ways to detect Unit's startup and subsequent readiness to accept
commands relies on waiting for the control socket file to be created.
Earlier, it was unreliable due to a race condition between the client's
connect() and the daemon's listen() calls after the socket's bind() call.

Now, unix domain listening sockets are created with a nxt_listen_socket_create()
call as follows:

s = socket();
unlink("path/to/socket.tmp")
bind(s, "path/to/socket.tmp");
listen(s);
rename("path/to/socket.tmp", "path/to/socket");

This eliminates a time-lapse when the socket file is already created but nobody
is listening on it yet, which therefore prevents the condition described above.

Also, it allows reliably detecting whether the socket is being used or simply
wasn't cleaned after the daemon stopped abruptly. A successful connection to
the socket file means the daemon has been started; otherwise, the file can be
overwritten.

show more ...


# 1449:8bcb79f5d69d 08-Apr-2020 Valentin Bartenev

Removed unused code related to testing of address binding.


# 1448:c2933095c503 08-Apr-2020 Valentin Bartenev

Controller: eliminated extra control socket's sockaddr copying.


Revision tags: 1.16.0-1, 1.16.0
# 1364:9f385f0e18aa 20-Feb-2020 Valentin Bartenev

Configuration: removing UTF-8 BOM from the input JSON.

Some editors can add it to JSON files.


Revision tags: 1.15.0-1, 1.15.0, 1.14.0-1, 1.14.0, 1.13.0-1, 1.13.0, 1.12.0-1, 1.12.0, 1.11.0-2, 1.11.0-1, 1.11.0
# 1167:a49ee872e83d 16-Sep-2019 Valentin Bartenev

Configuration: added ability to access object members with slashes.

Now URI encoding can be used to escape "/" in the request path:

GET /config/listeners/unix:%2Fpath%2Fto%2Fsocket/


Revision tags: 1.10.0-2, 1.10.0-1, 1.10.0, 1.9.0-1, 1.9.0
# 1049:961567625038 24-Apr-2019 Valentin Bartenev

Configuration: support for POST operations on arrays.

It allows to add an array element without specifying the index.


# 1013:4ca8428d231b 22-Mar-2019 Max Romanov

Destroying pool in case of error.

This closes #233 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).


Revision tags: 1.8.0-1, 1.8.0, 1.7.1-1, 1.7.1, 1.7-1, 1.7, 1.6-1, 1.6, 1.5-1, 1.5, 1.4-2, 1.4
# 776:a65ab003835c 20-Sep-2018 Max Romanov

Preserving inherited engine memory pool in controller process.

The pool is inherited from master process since changeset 854a1a440616.


# 774:b21709350c49 20-Sep-2018 Valentin Bartenev

Controller: certificates storage interface.


Revision tags: 1.3
# 710:1215acd43810 02-Jul-2018 Valentin Bartenev

Controller: fixed handling of zero Content-Length.


# 703:2d536dde84d2 25-Jun-2018 Valentin Bartenev

Introduced nxt_length() macro.


Revision tags: 1.2
# 673:9fa79c719a17 21-May-2018 Valentin Bartenev

Added SERVER_SOFTWARE request meta-variable.


Revision tags: 1.1
# 662:053984ce0c4e 26-Apr-2018 Max Romanov

Controller waits READY message from router.

This required to avoid racing condition when controller receive router
port before router receives controller port.


# 645:1c993ea13906 17-Apr-2018 Valentin Bartenev

Added missing checks if nxt_port_rpc_register_handler() failed.

This closes #97 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).


Revision tags: 1.0
# 632:a92721a99956 11-Apr-2018 Valentin Bartenev

Controller: added "/config" prefix for the configuration object.


1234