Commit Graph

22 Commits

Author SHA1 Message Date
Valentin Bartenev
e7d81186b5 Fixed controller restarting.
Previously, stored configuration wasn't reread on controller
process restart, which resulted in segmentation fault.
2017-10-19 17:43:54 +03:00
Max Romanov
b3aab8c66f Filtering process to keep connection.
- Main process should be connected to all other processes.
- Controller should be connected to Router.
- Router should be connected to Controller and all Workers.
- Workers should be connected to Router worker thread ports only.

This filtering helps to avoid unnecessary communication and various errors
during massive application workers stop / restart.
2017-10-19 17:37:19 +03:00
Max Romanov
6532e46465 Supporting concurrent shared memory fd receive in router.
Two different router threads may send different requests to single
application worker.  In this case shared memory fds from worker
to router will be send over 2 different router ports.  These fds
will be received and processed by different threads in any order.

This patch made possible to add incoming shared memory segments in
arbitrary order.  Additionally, array and memory pool are no longer
used to store segments because of pool's single threaded nature.

Custom array-like structure nxt_port_mmaps_t introduced.
2017-10-19 17:36:56 +03:00
Max Romanov
e44401a0bb Introducing process use counter.
This helps to decouple process removal from port memory pool cleanups.
2017-10-04 15:02:11 +03:00
Max Romanov
ba31199786 Removing mem_pool from port_hash interface.
Memory pool is not used by port_hash and it was a mistake to pass it into
'add' and 'remove' functions.  port_hash enrties are allocated from heap.
2017-10-04 14:57:56 +03:00
Max Romanov
838d9946ac Introducing named port message handlers to avoid misprints. 2017-09-15 20:30:34 +03:00
Valentin Bartenev
f528cb393a Controller: waiting for router before start to accept connections.
Previously, reconfiguration might fail right after the daemon start
if the router process wasn't ready yet.
2017-08-30 03:10:13 +03:00
Max Romanov
92f3b85298 The process type enum exposed to go module. 2017-08-29 14:18:00 -07:00
Igor Sysoev
9d487df10d The master process has been renamed to the main process. 2017-08-29 02:59:35 +03:00
Igor Sysoev
949548da29 The new module configuration interface.
Configuration and building example:

  ./configure
  ./configure python
  ./configure php
  ./configure go
  make all

or

  ./configure
  make nginext
  ./configure python
  make python
  ./configure php
  make php
  ./configure go
  make go

Modules configuration options and building examples:

  ./configure python --module=python2 --config=python2.7-config
  make python2

  ./configure php --module=php7 --config=php7.0-config
                  --lib-path=/usr/local/php7.0
  make php7

  ./configure go --go=go1.6 --go-path=${HOME}/go1.6
  make go1.6
2017-08-17 21:47:19 +03:00
Max Romanov
f23f985899 Runtime processes protected with mutex. 2017-08-02 13:22:07 +03:00
Max Romanov
803855138c Mem pool cleanup introduced.
Used for connection mem pool cleanup, which can be used by buffers.
Used for port mem pool to safely destroy linked process.
2017-07-18 00:21:16 +03:00
Max Romanov
eb675f2d78 Port allocation and destroy changed. Worker process stop introduced. 2017-07-18 00:21:14 +03:00
Max Romanov
b0c1e740cf New process port exchange changed. READY message type introduced.
Application process start request DATA message from router to master.
Master notifies router via NEW_PORT message after worker process become ready.
2017-07-12 20:32:16 +03:00
Max Romanov
e58f4ef0d0 Memory pool thread safety checks in DEBUG build and usage fixes. 2017-07-07 16:01:34 +03:00
Max Romanov
83088a0f4b Incoming and outgoing port_mmap arrays are protected with mutexes. 2017-06-23 19:20:08 +03:00
Max Romanov
b8f126dcdf Added basic HTTP request processing in router.
- request to connection mapping in engine;
- requests queue in connection;
- engine port creation;
- connected ports hash for each process;
- engine port data messages processing (app responses);
2017-06-23 19:20:08 +03:00
Max Romanov
ac43bfcc72 nxt_process_create() changed to add process to runtime before callbacks. 2017-06-23 19:19:41 +03:00
Igor Sysoev
f888a5310c Using new memory pool implementation. 2017-06-20 19:49:17 +03:00
Max Romanov
f7b4bdfd89 Using shared memory to send data via nxt_port.
Usage:
    b = nxt_port_mmap_get_buf(task, port, size);
    b->mem.free = nxt_cpymem(b->mem.free, data, size);
    nxt_port_socket_write(task, port, NXT_PORT_MSG_DATA, -1, 0, b);
2017-05-12 20:32:41 +03:00
Igor Sysoev
6f2c9acd18 Processes refactoring.
The cycle has been renamed to the runtime.
2017-03-09 18:03:27 +03:00
Igor Sysoev
16cbf3c076 Initial version. 2017-01-17 20:00:00 +03:00