Amanda-Users

Re: Amanda TCP Reset Problem with CygWin

2003-04-02 13:50:23
Subject: Re: Amanda TCP Reset Problem with CygWin
From: Brian White <bcwhite AT precidia DOT com>
To: Enrico Bernardini <enrico AT adm.unipi DOT it>
Date: Wed, 02 Apr 2003 12:22:09 -0500
Man...  It's slow going when you only get to test your changes once a day!



> > > Look at my earlier post:
> > > http://www.cygwin.com/ml/cygwin/2001-12/msg00524.html (that solution was
> > > not right!)
> >
> > Why did a pause at the end of the process not work?  Or did it just not
> > work reliably?
> >
> 
> I don't remeber well, but I think the windows "close socket" does not
> send a "goodbye" nessage... never...
> Or it goes lost:
> +          /* A bug in the Windows TCP/IP implementation, which is not
> +             yet worked around in Cygwin (such a workaround is very
> +             difficult), causes the goodbye message to be lost if the
> +             process sending it exits before it's read by the other
> +             end.  Since this message doesn't contain any useful
> +             information anyway, it is safe for us to just not read it
> +             to avoid this problem. */
> 
> Try adding a sleep _before_ the close call in aclose define (amanda.h)
> and let me know.

As expected, the "sleep(1)" did nothing.  However, I did find other
postings recommending the use of "shutdown(fd,2)" instead.  I tried
that and, well, more worked than before.  The server reports:

/-- watertown. /home/watertown lev 0 STRANGE
sendbackup: start [watertown.ott.precidia.com:/home/watertown level 0]
sendbackup: info BACKUP=/usr/bin/tar
sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |/usr/bin/tar -f... -
sendbackup: info COMPRESS_SUFFIX=.gz
sendbackup: info end
| Total bytes written: 20480 (20kB, ?B/s)
? 
? gzip: stdout: Cannot send after transport endpoint shutdown
??error [compress returned 1]? dumper: strange [missing size line from 
sendbackup]
? dumper: strange [missing end line from sendbackup]
\--------

The same error message is on the client (naturally).  So, it looks like gzip
is still trying to send to the socket when sendbackup is closing the socket.

My guess is that the path was closed after it had been dup'd and so an
extra close wouldn't break things but a shutdown would.  I'm going to try
to figure out if that is the case.

                                          Brian
                                 ( bcwhite AT precidia DOT com )

-------------------------------------------------------------------------------
When you love someone, you're always insecure.  ("Tell Her About It" -- B.Joel)

<Prev in Thread] Current Thread [Next in Thread>