Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2005 09:27:50 +0300
From:      Dmitry Agaphonov <rzhe@agava.com>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Kevent(2) doesn't notify about EVFILT_WRITE filter event
Message-ID:  <20051205092750.1c6d4f5d@rzhe.agava-dubna.local>
In-Reply-To: <20051201185514.GP885@funkthat.com>
References:  <20051201150608.5e8d49f1@rzhe.agava-dubna.local> <20051201185514.GP885@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney wrote on 01.12.2005 10:55 MSK:

JMG> Dmitry Agaphonov wrote this message on Thu, Dec 01, 2005 at 15:06 +0300:
JMG> > I have two applications (server A and server B, A asks B for data to
JMG> > serve clients) communicating via UNIX-domain socket.  Testing local
JMG> > clients interact to server A via UNIX-domain sockets too.  Server A
JMG> > uses kqueue(2) to handle clients and server B.
JMG> > 
JMG> > When about 20 clients start requesting server A without delay, kevent(2)
JMG> > doesn't notify about requested EVFILT_WRITE after only few small
JMG> > requests.
JMG> > 
JMG> > 
JMG> > Dumping kevent(2) changelist and eventlist gives the following:
JMG> > 
JMG> > Server A asks for write event (with EV_ONESHOT flag set) to server B:
JMG> > [13:45:36][DBG] Changing SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 0, udata: 0x0
JMG> > [13:45:36][DBG] Received SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 8192, udata: 0x0
JMG> > 
JMG> > So, the socket send buffer has 8192 bytes free.  Then A sends 426
JMG> > bytes to B.
JMG> > 
JMG> > Then server A asks for write event again:
JMG> > [13:45:36][DBG] Changing SysEvent: ident: 8, filter: -2, flags: 0x11, fflags: 0, data: 0, udata: 0x0
JMG> > 
JMG> > After this, EVFILT_WRITE event is not returned.  Noone else writes to
JMG> > this socket.  How it is possible?
JMG> 
JMG> are you checking the output from the kevent that sets the sysevent?
JMG> kevent if you do something "stupid" like set a _ONESHOT in kevent, and
JMG> provide space for events to be returned to userland, the _ONESHOT will
JMG> be immediately returned and cleared...
JMG> 
JMG> It could also be an error is trying to be set, but can't be if you
JMG> don't provide return space...  so w/o seeing your code, I'd make sure
JMG> when setting you are able to receive some events, and check what events
JMG> you get back...

Not in this, but that was my fault.  Thank you for answer.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051205092750.1c6d4f5d>