summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-11-20Fixing Coverity warnings.Max Romanov1-4/+3
CID 200496 CID 200494 CID 200490 CID 200489 CID 200483 CID 200482 CID 200472 CID 200465
2017-10-19Filtering process to keep connection.Max Romanov1-5/+2
- 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-04Port message fragmentation supported.Max Romanov1-0/+2
- Each sendmsg() transmits no more than port->max_size payload data. - Longer buffers are fragmented and send using multiple sendmsg() calls. - On receive side, buffers are connected in chain. - Number of handler calls is the same as number of nxt_port_socket_write() calls. - nxt_buf_make_plain() function introduced to make single plain buffer from the chain.
2017-10-04Introducing process use counter.Max Romanov1-2/+9
This helps to decouple process removal from port memory pool cleanups.
2017-10-04Using port 'post' facility to proxy remove pid message to workers.Max Romanov1-1/+3
Remove pid proxying to worker engines implementation was originally overcomplicated. Memory pool and 2 engine posts (there and back again) are optimized out and replaced with band new nxt_port_post() call.
2017-10-04Introducing use counters for port and app. Thread safe port write.Max Romanov1-13/+116
Use counter helps to simplify logic around port and application free. Port 'post' function introduced to simplify post execution of particular function to original port engine's thread. Write message queue is protected by mutex which makes port write operation thread safe.
2017-10-04Using engine memiory pool for port write allocations.Max Romanov1-2/+4
To allow use port from different threads, the first step is to avoid using port's memory pool for temporary allocations required to send data through the port. Including but not limited by: - buffers for data; - send message structures; - new mmap fd notifications; It is still safe to use port memory pool for incoming buffers allocations because recieve operation bound to single thread.
2017-09-15Introducing named port message handlers to avoid misprints.Max Romanov1-3/+3
2017-09-15Introducing application timeout.Max Romanov1-2/+1
2017-09-06Style fixes.Igor Sysoev1-13/+12
2017-08-29The master process has been renamed to the main process.Igor Sysoev1-2/+2
2017-08-02Added basic port error handler.Max Romanov1-3/+29
2017-08-02Runtime processes protected with mutex.Max Romanov1-28/+6
2017-08-02Implicit port read buffer completion.Max Romanov1-3/+0
To disable implicit completion, handler should reset msg->buf field.
2017-08-02Using port rpc in router->master start worker request.Max Romanov1-1/+7
2017-08-02Port RPC interface introduced.Max Romanov1-0/+3
Usage: 1. Register handlers in incoming port with nxt_port_rpc_register_handler(). 2. Use return value as a stream identifier for next nxt_port_socket_write().
2017-07-18Request-app link introduced to prevent mp destroy for penging requests.Max Romanov1-0/+5
nxt_req_conn_link_t still used for lookup connection by request id. New nxt_req_app_link_t (ra) allocated from conn->mem_pool using mp_retain(). ra stored in app->requests if there is no free worker to process request.
2017-07-18Mem pool cleanup introduced.Max Romanov1-1/+1
Used for connection mem pool cleanup, which can be used by buffers. Used for port mem pool to safely destroy linked process.
2017-07-18Port allocation and destroy changed. Worker process stop introduced.Max Romanov1-13/+65
2017-07-12New process port exchange changed. READY message type introduced.Max Romanov1-17/+78
Application process start request DATA message from router to master. Master notifies router via NEW_PORT message after worker process become ready.
2017-07-07Process stop notification from master to all other processes.Max Romanov1-1/+21
New port message type introduced NXT_PORT_MSG_REMOVE_PID. Default handler removes process description from nxt_runtime_t with all ports, incoming and outgoing mmaps etc.
2017-07-07Redirecting buffer completion handler to specific engine.Max Romanov1-21/+1
There is a case in router where we use port in router connection thread. Buffers are allocated within connection memory pool which can be used only in this router thread. sendmsg() can be postponed into main router thread and completion handler will compare current engine and post itself to correct engine.
2017-06-23Added basic HTTP request processing in router.Max Romanov1-2/+0
- 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-23Extruded nxt_port_send_port() to send port to one process.Max Romanov1-26/+34
2017-06-23Store mem_pool in buf->data instead of port for consistency.Max Romanov1-5/+5
2017-06-23nxt_port_create() use task instead of thread.Max Romanov1-4/+3
Write socket close() call moved out from nxt_port_create().
2017-06-20Using new memory pool implementation.Igor Sysoev1-2/+2
2017-05-12Using shared memory to send data via nxt_port.Max Romanov1-50/+77
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-03-09Processes refactoring.Igor Sysoev1-41/+59
The cycle has been renamed to the runtime.
2017-02-22Port changes.Igor Sysoev1-74/+77
2017-02-22I/O operations refactoring.Igor Sysoev1-1/+1
2017-02-01Process channels have been renamed to ports.Igor Sysoev1-0/+265