Age | Commit message (Collapse) | Author | Files | Lines |
|
Found by Coverity (CID 276138).
|
|
This required to avoid racing condition when controller receive router
port before router receives controller port.
|
|
In order to reopen access log, the router process creates a memory pool
and allocates a buffer to send RPC message for the main process.
Previously, the memory pool was destroyed when RPC response handler was
called. It appeared, that the buffer completion handler could be not
triggered by that time and still remained in a queue.
Now the memory pool is destroyed only after both events are happen.
|
|
|
|
This closes #97 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
|
|
|
|
|
|
Server error response generated or connection closed.
|
|
|
|
|
|
|
|
|
|
|
|
Request can be terminated because of invalid response headers and content
should be ignored in this case.
|
|
|
|
This retains application during reconfiguration if an incoming connection
was already established before the reconfiguration, but no request was yet
created for the connection and thus no application was yet assigned to
the request.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the first buffer contained only header and there were other buffers in chain,
those buffers were not processed. In particular, this broke Perl application
responses with empty body.
|
|
|
|
- Pre-fork 'processes.spare' application processes;
- fork more processes to keep 'processes.spare' idle processes;
- fork on-demand up to 'processes.max' count;
- scale down idle application processes above 'processes.spare' after
'processes.idle_timeout';
- number of concurrently started application processes also limited by
'processes.spare' (or 1, if spare is 0).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
New optional configuration parameter introduced: limits.reschedule_timeout.
Default value 1 second. In the case when request is written to the port
socket 'in advance', it is called 'pending'.
On every completed request, the head of pending request is checked against
reschedule timeout. If this request waiting for execution longer than
timeout, it is cancelled, new port selected for this request.
|
|
|
|
Application timeout limits maximum time of worker response in processing
particular request. Not including the time required to start worker,
time in request queue etc.
|
|
This patch increase precedence of non-started worker over busy worker.
1. idle worker;
2. start new worker;
3. busy worker, but can accept request in advance;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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.
|
|
Only purpose of request<->app link instance is to be enqueued in application
requests queue.
It is possible to avoid request<->app link allocation from memory pool in
case when spare application port is available. Instance from local stack
can be used to prepare and send message to application.
|
|
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.
|
|
Request <-> application link structure (nxt_req_app_link_t) used to register
the request in application request queue (nxt_app_t.requests) and generate
application-specific port message.
Now it is allocated from request pool. This pool created for request parsing
and used to allocate and store information specific to this request.
|
|
Request can be processed in thread different from the thread where the
connection originally handled.
Because of possible racing conditions, using original connection structures
is unsafe. To solve this, error condition is registered in 'ra' (request <->
application link) and traversed back to original connection thread where
the error message can be generated and send back to client.
|
|
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.
|