summaryrefslogtreecommitdiffstats
path: root/source3/lib/events.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: Remove select-based s3 event backendVolker Lendecke2011-02-281-114/+0
|
* s3: Use poll for the event loopVolker Lendecke2011-02-281-13/+267
|
* s3:lib/events: use DLIST_DEMOTE() for fd eventsStefan Metzmacher2011-01-311-0/+1
| | | | | | | | | | This makes sure that fd events doesn't dry out, because a fd with a lower number is busy. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Jan 31 16:59:44 CET 2011 on sn-devel-104
* s3:lib/events: don't loop over fd events is select gave -1Stefan Metzmacher2011-01-311-1/+1
| | | | metze
* Revert "s3:events: Call all ready fd event handlers on each iteration of the ↵Stefan Metzmacher2011-01-311-15/+7
| | | | | | | | | | main loop" This reverts commit 455fccf86b6544cd17a2571c63a88f8aebff3f74. I'll add a more generic fix for this problem. metze
* Revert "s3: Fix an infinite loop"Volker Lendecke2011-01-241-4/+0
| | | | | | | This reverts commit 61f7d7cdeccb1f733590e8bdb8229b32363a815e. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Jan 24 10:10:43 CET 2011 on sn-devel-104
* s3: Fix an infinite loopVolker Lendecke2011-01-231-0/+4
| | | | | | | | | | | | | | | | | | | | | If select returns EBADF (which should NEVER happen), then we loop infinitely because the select masks seem all active. I've been given an strace where smbd floods syslog with inotify-related error messages. The strace shows that select returns EBADF, and we're calling the inotify event callback. It then complains there's no data on the inotify fd. Metze, please check! We might need to fix this in 3.4 and 3.5 as well. And we need to find the deeper reason where we close a file descriptor and don't tell the events system about it. Volker Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Jan 23 10:05:39 CET 2011 on sn-devel-104
* All calls to event_add_to_select_args() call GetTimeOfDay() andJeremy Allison2010-12-231-6/+5
| | | | | | | | | | | pass this in as the &now parameter. Push this call inside of event_add_to_select_args() to the correct point so it doesn't get called unless needed. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
* s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman2010-10-011-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only one fd handler was being called per main message loop in all smbd child processes. In the case where multiple fds are available for reading the fd corresponding to the event closest to the beginning of the event list would be run. Obviously this is arbitrary and could cause unfairness. Usually, the first event fd is the network socket, meaning heavy load of client requests can starve out other fd events such as oplock or notify upcalls from the kernel. In this patch, I have changed the behavior of run_events() to unset any fd that it has already called a handler function, as well as decrement the number of fds that were returned from select(). This allows the caller of run_events() to iterate it, until all available fds have been handled. I then changed the main loop in smbd child processes to iterate run_events(). This way, all available fds are handled on each wake of select, while still checking for timed or signalled events between each handler function call. I also added an explicit check for EINTR from select(), which previously was masked by the fact that run_events() would handle any signal event before the return code was checked. This required a signature change to run_events() but all other callers should have no change in their behavior. I also fixed a bug in run_events() where it could be called with a selrtn value of -1, doing unecessary looping through the fd_event list when no fds were available. Also, remove the temporary echo handler hack, as all fds should be treated fairly now.
* samba: share select wrappers.Günther Deschner2010-10-011-0/+1
| | | | Guenther
* s3-event: switch s3 to using tevent_re_initialise()Andrew Tridgell2010-03-261-6/+0
| | | | | | This correctly initialises the event backend, and checks for errors (thanks to Metze for suggesting this)
* s3: Remove some unused codeVolker Lendecke2010-03-141-20/+0
|
* s3-events: make the old timed events compatible with teventAndrew Tridgell2010-02-051-2/+19
| | | | | | | | | | | | tevent ensures that a timed event is only called once. The old events code relied on the called handler removing the event itself. If the handler removed the event after calling a function which invoked the event loop then the timed event could loop forever. This change makes the two timed event systems more compatible, by allowing the handler to free the te if it wants to, but ensuring it is off the linked list of events before the handler is called, and ensuring it is freed even if the handler doesn't free it.
* Quieten events and tldap debug messagesVolker Lendecke2009-07-101-1/+1
|
* s3-events: Not only timed, also immediate events generate a timeout returnVolker Lendecke2009-05-171-1/+1
|
* s3-events: If immediate requests are pending, the timeout is 0Volker Lendecke2009-05-161-0/+9
|
* s3:events: add support for immediate eventsStefan Metzmacher2009-03-171-9/+15
| | | | metze
* s3:events: make use of tevent_common_loop_wait()Stefan Metzmacher2009-03-171-12/+1
| | | | metze
* s3:events: pass __location__ to event_loop_*()Stefan Metzmacher2009-03-121-3/+3
| | | | metze
* Fix "ignore return" warning.Jeremy Allison2009-03-031-2/+3
| | | | Jeremy.
* s3:events: map TEVENT_DEBUG_TRACE to debug level 10Stefan Metzmacher2009-02-251-1/+1
| | | | metze
* Avoid valgrind errorsVolker Lendecke2009-01-281-35/+13
| | | | | | | | | | | | | In event handlers, we might destroy other events that are pending in the lists. We can only run one event safely per select call. Yes, I've seen these valgrind errors :-) Jeremy, with ccdd921e61 you had checked in the change to run multiple events. Do you remember why it was necessary and could not be solved in a different way? Volker
* s3:events: always run_events() before sys_select()Stefan Metzmacher2009-01-221-5/+4
| | | | | | We might have pending signal events not only timed events. metze
* s3:events: add support for signal eventsStefan Metzmacher2009-01-201-0/+6
| | | | metze
* s3:events: debug sys_select() errorsStefan Metzmacher2009-01-091-0/+3
| | | | metze
* s3:events: install a tevent debug handler that calls DEBUG()Stefan Metzmacher2009-01-091-1/+42
| | | | metze
* s3:events: use more tevent_common_* functionsStefan Metzmacher2009-01-051-158/+6
| | | | metze
* s3:events: register as tevent backendStefan Metzmacher2009-01-051-137/+172
| | | | metze
* s3:events: get rid of the stupid set_event_dispatch_time() functionStefan Metzmacher2009-01-051-16/+0
| | | | metze
* s3:events: get rid of the stupid cancel_named_event() functionStefan Metzmacher2009-01-051-16/+0
| | | | metze
* s3:events: change event_add_timed() prototype to match samba4Stefan Metzmacher2009-01-051-4/+4
| | | | metze
* s3:events: remove unused stuffStefan Metzmacher2009-01-051-25/+0
| | | | metze
* clean event context after child is forked.Bo Yang2009-01-051-0/+6
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Cope with changed signature of http_timestring().Jelmer Vernooij2008-10-111-1/+1
|
* Make events robust against their event_context being freedVolker Lendecke2008-08-101-5/+28
| | | | (This used to be commit 3d4e7b29c235e329aaea4fa2c2078df0ce3e59eb)
* Fix max_fd calculation in event_loop_onceVolker Lendecke2008-06-111-1/+1
| | | | | | | | | | | For some bugs I really wonder how they can go undetected for so long. Fix a bug reported by Mathias Dietz. No samba bugzilla entry, but still 100% needed for 3-2-stable. Volker (cherry picked from commit 82c994dabc47bb4755c883a1f3651bb5d65cf2c5) (This used to be commit 91c73e093a03b10426b671cb3e1dffb8a2455d47)
* lib/events: use mem_context given to event_context_init().Michael Adam2008-05-281-1/+1
| | | | | Michael (This used to be commit f872a1f4428ed64bcfd832d981eea6446f05339e)
* Enable multiple fd events on a single file descriptorVolker Lendecke2008-04-141-1/+1
| | | | | | | Now we can have multiple events listen on a single fd. The order in which they are called is naturally not defined, meaning that it is only deterministic if exactly one event is readable or writeable. (This used to be commit 61503f822b60f98dd1f7549707ec89b48e32caeb)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-5/+5
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* r25257: When dumping eventlist, display full timestring.Günther Deschner2007-10-101-2/+3
| | | | | Guenther (This used to be commit 38eca60913f513accb24b31dcb6d1d7e92b0ba66)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r23569: Also dump fd_event in dump_event_list().Günther Deschner2007-10-101-1/+10
| | | | | Guenther (This used to be commit 27fdf995d13611ebc9e57895f886c184e9027c4d)
* r23562: Add dump_event_list() for debugging the event list.Günther Deschner2007-10-101-0/+24
| | | | | Guenther (This used to be commit 4e1e697ac48513719bd3a2152f17871bc00df796)
* r23015: Make message_(de)register static to messages.cVolker Lendecke2007-10-101-0/+15
| | | | (This used to be commit a8082a3c7c3d1e68c27fc3bf42f3d44402cc6f9f)
* r22934: Change smbcontrol to use messaging_register instead of message_registerVolker Lendecke2007-10-101-2/+45
| | | | (This used to be commit e3d985c581ffc597aea932858d27c421643d2868)
* r20913: Fix the build.Jeremy Allison2007-10-101-3/+4
| | | | | Jeremy. (This used to be commit dce98dae2d18126d8380f92595f315b96d48a7df)
* r20912: Ensure the list always remains sorted even whenJeremy Allison2007-10-101-17/+29
| | | | | | moving events around. Jeremy. (This used to be commit 6fee874ab420b4c406e38b5e189a6d6ea8594fc9)
* r20846: Before this gets out of control...Volker Lendecke2007-10-101-22/+197
| | | | | | | | | | | | This add a struct event_context and infrastructure for fd events to smbd. This is step zero to import lib/events. Jeremy, I rely on you to watch the change in receive_message_or_smb() closely. For the normal code path this should be the only relevant change. The rest is either not yet used or is cosmetic. Volker (This used to be commit cd07f93a8aecb24c056e33b1ad3447a41959810f)
* r20087: Ensure we clean up any random pending events weJeremy Allison2007-10-101-0/+15
| | | | | | | may have inherited from our parent in the winbindd forked child. Jeremy. (This used to be commit 0a1352f440a9d9b974ad8d571b2e48a43a15b6cc)