how to deal with STATUS_PIPE_BUSY ?
Cole, Timothy D.
timothy_d_cole at md.northgrum.com
Wed Jul 17 13:38:02 GMT 2002
Assuming NT means here what it usually does by STATUS_PIPE_BUSY, it might be
useful to look at what the Win32 API call WaitNamedPipe() does over the
network.
My (maybe helpful, maybe not) understanding of this:
STATUS_PIPE_BUSY means that all instances of the current named pipe are
busy. The way named pipes work in NT is that they can have multiple
instances "stacked" on the same name, each created by a call to
CreateNamedPipe() with a given pipe name.
When CreateFile is called (by a client) to connect to the pipe, it gets a
handle to the first availible instance and talks back and forth on that
instance until the handle is closed, at which point the instance becomes
availible again. If all the availible instances are being used, then
CreateFile() fails with STATUS_PIPE_BUSY.
WaitNamedPipe() apparently does some notification magic and returns when
there is a free instance again. So it's probably worthwhile to do a network
trace and see how it requests/recieves that notification (if we don't
already have that documented somewhere) ... presumably it doesn't just poll,
as then there'd be no advantage over polling with CreateFile().
[ IMO the real solution should have been to have CreateFile() or an analogue
block, waiting for an availible instance (or return STATUS_PIPE_BUSY after a
timeout) ]
[ The Win32 API call CallNamedPipe() is just a wrapper for the
CreateFile()/[WaitNamedPipe()/CreateFile().../]TransactNamedPipe()/CloseHand
le() dance. ]
> -----Original Message-----
> From: Ben Johnson [mailto:ben at blarg.net]
> Sent: Wednesday, July 17, 2002 15:53
> To: Tim Potter; samba-technical at lists.samba.org
> Subject: Re: how to deal with STATUS_PIPE_BUSY ?
>
>
> On Wed, Jul 17, 2002 at 11:46:51AM -0700, Tim Potter wrote:
> > On Wed, Jul 17, 2002 at 11:17:34AM -0700, Ben Johnson wrote:
> > > Do you think I just need to wait a little while then
> resend the request?
> > > Is it just that NT needs some time to rearrange its
> buffers or something?
> > > That doesn't make much sense to me, but I can't figure
> out what else it
> > > would be.
> >
> > Yes. I haven't had a chance to try this out with any of the Samba
> > daemons so please let me know if this works.
>
> I told my thing to retry sending the same packet 6 times while waiting
> for 10 seconds between each and I got a STATUS_PIPE_BUSY back
> from each
> request. Because I am probably the only one accessing this
> NT server I
> think there can't be a lack of resources available to handle
> my request.
> I don't know what's up.
More information about the samba-technical
mailing list