summaryrefslogtreecommitdiffhomepage
path: root/src/event/modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-03-21Events: fixed test building with devpoll and eventport on Linux.Sergey Kandaurov2-1/+3
Avoid POLLREMOVE and itimerspec redefinition.
2016-03-18Fixed timeouts with threaded sendfile() and subrequests.Maxim Dounin1-0/+3
If a write event happens after sendfile() but before we've got the sendfile results in the main thread, this write event will be ignored. And if no more events will happen, the connection will hang. Removing the events works in the simple cases, but not always, as in some cases events are added back by an unrelated code. E.g., the upstream module adds write event in the ngx_http_upstream_init() to track client aborts. Fix is to use wev->complete instead. It is now set to 0 before a sendfile() task is posted, and it is set to 1 once a write event happens. If on completion of the sendfile() task wev->complete is 1, we know that an event happened while we were executing sendfile(), and the socket is still ready for writing even if sendfile() did not sent all the data or returned EAGAIN.
2016-03-15Events: fixed error logging in devpoll.Roman Arutyunyan1-1/+1
2015-05-06Events: made a failure to create a notification channel non-fatal.Ruslan Ermilov1-1/+1
This may happen if eventfd() returns ENOSYS, notably seen on CentOS 5.4. Such a failure will now just disable the notification mechanism and let the callers cope with it, instead of failing to start worker processes. If thread pools are not configured, this can safely be ignored.
2015-04-23Removed the obsolete rtsig module.Ruslan Ermilov1-735/+0
2015-04-22Removed the obsolete aio module.Ruslan Ermilov2-172/+1
2015-03-26Removed NGX_OLD_THREADS from select and poll modules.Ruslan Ermilov2-20/+0
These modules can't be compiled on win32.
2015-03-27Events: fixed possible crash on start or reload.Valentin Bartenev1-2/+2
The main thread could wake up and start processing the notify event before the handler was set.
2015-03-20Removed unix ngx_threaded and related ngx_process_changes.Ruslan Ermilov10-95/+9
2015-03-20Removed old pthread implementation.Ruslan Ermilov1-50/+0
2015-03-14Events: implemented eventport notification mechanism.Ruslan Ermilov1-1/+34
2015-03-14Events: implemented kqueue notification mechanism.Valentin Bartenev1-0/+76
2015-03-14Events: implemented epoll notification mechanism.Valentin Bartenev1-2/+139
2015-03-14Thread pools implementation.Valentin Bartenev10-0/+10
2015-03-04Renamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.Ruslan Ermilov3-5/+5
It's mostly dead code and the original idea of worker threads has been rejected.
2015-03-12Events: fixed typo in the error message.Ruslan Ermilov1-1/+1
2014-10-11Win32: fixed wrong type cast.Kouhei Sutou1-1/+1
GetQueuedCompletionStatus() document on MSDN says the following signature: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364986.aspx BOOL WINAPI GetQueuedCompletionStatus( _In_ HANDLE CompletionPort, _Out_ LPDWORD lpNumberOfBytes, _Out_ PULONG_PTR lpCompletionKey, _Out_ LPOVERLAPPED *lpOverlapped, _In_ DWORD dwMilliseconds ); In the latest specification, the type of the third argument (lpCompletionKey) is PULONG_PTR not LPDWORD.
2014-09-01Events: processing of posted events changed from LIFO to FIFO.Valentin Bartenev8-9/+18
In theory, this can provide a bit better distribution of latencies. Also it simplifies the code, since ngx_queue_t is now used instead of custom implementation.
2014-09-01Events: removed broken thread support from posted events.Valentin Bartenev8-148/+47
It's mostly dead code. And the idea of thread support for this task has been deprecated.
2014-08-10Events: removed unused variable in ngx_poll_process_events().Maxim Dounin1-4/+1
2014-08-07Events: format specifier fixes.Yves Crespin2-6/+6
2014-08-07Events: changed nevents type to unsigned in poll module.Yves Crespin1-6/+6
2014-05-23Events: use eventfd() instead of syscall(SYS_eventfd) if possible.Ruslan Ermilov1-4/+4
This fixes --with-file-aio support on systems that lack eventfd() syscall, notably aarch64 Linux. The syscall(SYS_eventfd) may still be necessary on systems that have eventfd() syscall in the kernel but lack it in glibc, e.g. as seen in the current CentOS 5 release.
2013-07-12Events: support for EPOLLRDHUP (ticket #320).Valentin Bartenev1-5/+13
Since Linux 2.6.17, epoll is able to report about peer half-closed connection using special EPOLLRDHUP flag on a read event.
2013-09-04Win32: MinGW GCC compatibility.Maxim Dounin2-3/+3
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2013-09-02Added the NGX_EBADF define.Valentin Bartenev1-1/+1
2013-08-20Format specifier fixes in error logging.Sergey Kandaurov1-2/+2
2013-04-16Events: backout eventport changes (r5172) for now.Maxim Dounin1-8/+0
Evenport method needs more work. Changes in r5172, while being correct, introduce various new regressions with current code.
2013-04-12Events: fixed typos in two previous commits.Valentin Bartenev2-2/+2
2013-04-12Events: handle only active events in eventport.Valentin Bartenev1-0/+8
We generate both read and write events if an error event was returned by port_getn() without POLLIN/POLLOUT, but we should not try to handle inactive events, they may even have no handler.
2013-04-12Events: protection from stale events in eventport and devpoll.Valentin Bartenev2-2/+8
Stale write event may happen if read and write events was reported both, and processing of the read event closed descriptor. In practice this might result in "sendfilev() failed (134: ..." or "writev() failed (134: ..." errors when switching to next upstream server. See report here: http://mailman.nginx.org/pipermail/nginx/2013-April/038421.html
2013-01-25Events: fixed null pointer dereference with resolver and poll.Ruslan Ermilov1-2/+2
A POLLERR signalled by poll() without POLLIN/POLLOUT, as seen on Linux, would generate both read and write events, but there's no write event handler for resolver events. A fix is to only call event handler of an active event.
2012-07-24Fixed compilation with -Wmissing-prototypes.Ruslan Ermilov3-5/+52
2012-04-03Fixed spelling in multiline C comments.Ruslan Ermilov3-4/+4
2012-01-18Copyright updated.Maxim Konovalov11-0/+11
2011-11-29Fixed AIO on Linux, broken in r4306.Maxim Dounin1-10/+10
Events from eventfd do not have c->write set, and the stale event check added in r4306 causes null pointer dereference.
2011-11-22Protection from stale write events in epoll.Maxim Dounin1-0/+12
Stale write event may happen if epoll_wait() reported both read and write events, and processing of the read event closed descriptor. Patch by Yichun Zhang (agentzh).
2011-09-20The "worker_aio_requests" directive.Igor Sysoev1-3/+13
The default value is 32 AIO simultaneous requests per worker. Previously they were hardcoded to 1024, and it was too large, since Linux allocated them early on io_setup(), but not on request itself. So with default value of /proc/sys/fs/aio-max-nr equal to 65536 only 64 worker processes could be run simultaneously. 32 AIO requests are enough for modern disks even if server runs only 1 worker.
2011-09-16Fixing Linux AIO initiatialization: AIO operations are disabled if kernelIgor Sysoev1-47/+82
does not support them. Previously worker just exited.
2011-09-16Fixing Linux AIO syscalls return value handling:Igor Sysoev1-10/+11
syscall(2) uses usual libc convention, it returns -1 on error and sets errno. Obsolete _syscall(2) returns negative value of error. Thanks to Hagai Avrahami.
2011-04-23fix building by gcc 4.6 without --with-debugIgor Sysoev1-10/+3
2010-03-25*) introduce ngx_time_sigsafe_update() to update the error log time onlyIgor Sysoev9-15/+15
*) change ngx_time_update() interface
2010-03-13*) use previously cached GMT offset value to update time from a signal handlerIgor Sysoev9-15/+15
*) change ngx_time_update() interface since there are no notification methods those return time
2010-03-12do not update time in the timer signal handler,Igor Sysoev5-5/+5
since localtime_r() is not Async-Signal-Safe function
2009-11-23add NGX_PROCESS_HELPER process statusIgor Sysoev3-3/+3
2009-08-28FreeBSD and Linux AIO supportIgor Sysoev1-0/+217
2009-08-25*) move small declarations in appropriate places and delete the surplusIgor Sysoev4-25/+2
header files *) delete insignificant comments
2009-08-25style fixIgor Sysoev7-32/+6
2009-06-02return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev5-5/+5
2009-05-14style fixIgor Sysoev1-2/+4