ptproxy (was Re: [OpenAFS-devel] IBM public license code (from
OpenAFS) in samba/examples/nss ok?)
Jeffrey Hutzelman
jhutz@cmu.edu
Fri, 27 Aug 2004 09:12:42 -0400
On Friday, August 27, 2004 09:09:23 +0200 Volker Lendecke
<Volker.Lendecke@SerNet.DE> wrote:
> On Thu, Aug 26, 2004 at 09:46:35PM -0400, Derrick J Brashear wrote:
>> Ignoring the licensing question for the moment; I'm curious how heavily
>> you've exercised this, if winbind can end up blocking, and, if you tried
>> that case, how the fileserver dealt.
>
> If you look at winbind in Samba HEAD, you will see that I'm in the
> process of getting it as non-blocking as possible. Currently winbind is
> strictly serialized, in the future it will be able to have multiple
> requests outstanding. A single request however might be blocked by a
> broken or overloaded Windows DC. No idea what I should do then. Is there
> a RX error message "I'm working on it, come back later" or something like
> that?
Ho; there doesn't need to be -- there is a connection keepalive mechanism,
so as long as the server is actually there and responding, it can take as
long as it wants to actually process an RPC.
However, since LWP is non-preemptive, your RPC processing must not block
forever without letting other threads make progress. There are two main
ways to do this:
- If you are waiting on I/O from something else, like the winbind server,
don't make blocking I/O calls. Instead, use IOMGR_Select() to wait
for the file descriptor you care about to become ready. This works
just like select(), but allows other LWP theads to run while you are
waiting for I/O.
- If you are doing something that is compute intensive, call IOMGR_Poll()
periodically. This allows other threads that are waiting for I/O
(such as other worker threads, or the Rx listener thread).
Of course, if your goal is to support real AFS fileservers, then you do
need to be relatively responsive. Any time a fileserver makes a GetCPS
call, some fileserver RPC is blocking waiting for that to complete. If too
many requests from the same fileserver are blocked at the same time, that
fileserver will run out of worker threads, and even requests which can be
satisfied without a call to the ptserver (which is most of them) will not
be processed.
-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
Sr. Research Systems Programmer
School of Computer Science - Research Computing Facility
Carnegie Mellon University - Pittsburgh, PA