Amanda-Users

Re: Amanda TCP Reset Problem with CygWin

2003-04-10 11:37:40
Subject: Re: Amanda TCP Reset Problem with CygWin
From: Brian White <bcwhite AT precidia DOT com>
To: Amanda Users <amanda-users AT amanda DOT org>, Enrico Bernardini <enrico AT adm.unipi DOT it>
Date: Thu, 10 Apr 2003 09:51:09 -0400
Success!!!


> So...  I went in to sendbackup-gnutar.c and #if'd out some lines:
> 
>     /* close the write ends of the pipes */
> 
>     aclose(dumpin);
>     aclose(dumpout);
> #if 0 // moved to sendbackup.c
>     aclose(dataf);
>     aclose(mesgf);
>     if (options->createindex)
>         aclose(indexf);
> #endif
> 
> Then I went in to sendbackup.c and added the same there:
> 
>     program->start_backup(g_options->hostname, disk, amdevice, level, 
> dumpdate,
>                           dataf, mesgpipe[1], indexf);
>     parse_backup_messages(mesgpipe[0]);
> 
> #if 1 // moved from sendbackup-*.c
>     dbprintf(("%s: closing paths 
> (%d,%d,%d)\n",debug_prefix(NULL),indexf,mesgf,dataf));
>     shutdown(dataf,2);
>     aclose(dataf);
>     shutdown(mesgf,2);
>     aclose(mesgf);
>     if (!interactive && options->createindex) {
>         shutdown(indexf,2);
>         aclose(indexf);
>     }
> #endif
> 
> This way, there is no longer a local "aclose(dataf)" and "aclose(mesgf)"
> command while there are external processes still writing to that socket.
> Things have improved, but still don't look correct.  Here's the message
> from the server:
> 
> /-- watertown. /home/watertown lev 1 FAILED [data timeout]
> sendbackup: start [watertown.ott.precidia.com:/home/watertown level 1]
> 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: 10240 (10kB, ?B/s)
> \--------


The problem was the removed "close" statement from "sendbackup-gnutar.c".
The "mesgf" path was not a socket as I thought, but rather a pipe to
the indexing thread.  Thus, because it wasn't closed until after all
messages had been parsed and the message parser never exited until it had
no more messages to read (which wouldn't happen until all input paths to
the pipe closed), deadlock occurred and the system never finished.  In
fact, the "sendbackup" process never exited which is while the .exe file
stayed "busy" and I had trouble installing the new version.  Whew!

Anyway, the amanda client for CygWin is now running and doing backups
successfully without any changes required to the server.  I will not attempt
to back out the multitude of changes I made while trying to solve the above
problem to come up with the minimum change necessary.  Fun, fun, fun...

                                          Brian
                                 ( bcwhite AT precidia DOT com )

-------------------------------------------------------------------------------
The future is not set.  There is no fate but what we make for ourselves.  -- JC

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