From: Kern Sibbald Date: Wed, 22 Jan 2003 13:57:18 +0000 (+0000) Subject: Add timer to FIFO read/write opens X-Git-Tag: Release-1.29~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2f75390c66575211a75ed2052affe12e1a9c36b2;p=bacula%2Fbacula Add timer to FIFO read/write opens git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@312 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 59a39d1415..2d07db1ba1 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -17,26 +17,23 @@ Testing to do: (painful) - blocksize recognition code. For 1.29 release: +- Add whereabslinks to where or not where absolute links + +For 1.30 release: +- Get correct error status from run_program or open_bpipe(). - Look at handling <> in smtp doesn't work with exim. -- InitVerify is getting pruned and it shouldn't - Priority job to go to top of list. - Implement Bar code handling - Why is catreq.c:111 Find vol called twice for a job? - Find out why Full saves run slower and slower (hashing?) -- Make 1.28c release ??? -- Make sure btraceback goes into /sbin not sysconf directory. -- Get correct error status from run_program or open_bpipe(). -- Figure out how to allow multiple simultaneous file Volumes on - a single device. +- Figure out how to allow multiple simultaneous file Volumes on a single device. - Why are save/restore of device different sizes (sparse?) Yup! Fix it. - - Implement some way for the Console to dynamically create a job. - Restore to a particular time -- e.g. before date, after date. - Implement SHA1 - Implement disk spooling - Implement finer multiprocessing options. - Solaris -I on tar for include list -- Add whereabslinks to where or not where absolute links - Enable avoid backing up archive device (findlib/find_one.c:128) - Implement FileOptions (see end of this document) - Implement Bacula plugins -- design API @@ -824,3 +821,7 @@ Done: (see kernsdone for more) (not necessary) - Rewrite find_one.c to use only pool_memory instead of alloca and malloc (probably not necessary). +- Make sure btraceback goes into /sbin not sysconf directory. +- InitVerify is getting pruned and it shouldn't (document it) +- Make 1.28c release ??? NO do 1.29 directly +- Set timeout on opening fifo for save or restore (findlib) diff --git a/bacula/scripts/Makefile.in b/bacula/scripts/Makefile.in index 4aee059888..c6471f1068 100755 --- a/bacula/scripts/Makefile.in +++ b/bacula/scripts/Makefile.in @@ -28,6 +28,7 @@ depend: installdirs: $(MKDIR) $(DESTDIR)$(sysconfdir) + $(MKDIR) $(DESTDIR)$(sbindir) install: installdirs $(INSTALL_SCRIPT) startmysql $(DESTDIR)$(sysconfdir)/startmysql @@ -36,8 +37,8 @@ install: installdirs $(INSTALL_SCRIPT) bacula $(DESTDIR)$(sysconfdir)/bacula $(INSTALL_SCRIPT) fd $(DESTDIR)$(sysconfdir)/fd $(INSTALL_SCRIPT) mtx-changer $(DESTDIR)$(sysconfdir)/mtx-changer - $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sysconfdir)/btraceback - $(INSTALL_DATA) btraceback.gdb $(DESTDIR)$(sysconfdir)/btraceback.gdb + $(INSTALL_SCRIPT) btraceback $(DESTDIR)$(sbindir)/btraceback + $(INSTALL_DATA) btraceback.gdb $(DESTDIR)$(sbindir)/btraceback.gdb uninstall: (cd $(DESTDIR)$(sysconfdir); $(RMF) startmysql) @@ -46,8 +47,8 @@ uninstall: (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula) (cd $(DESTDIR)$(sysconfdir); $(RMF) fd) (cd $(DESTDIR)$(sysconfdir); $(RMF) mtx-changer) - (cd $(DESTDIR)$(sysconfdir); $(RMF) btraceback) - (cd $(DESTDIR)$(sysconfdir); $(RMF) btraceback.gdb) + (cd $(DESTDIR)$(sbindir); $(RMF) btraceback) + (cd $(DESTDIR)$(sbindir); $(RMF) btraceback.gdb) Makefile: Makefile.in cd $(topdir) \ diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 9dca295e71..4d7e009229 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -176,11 +176,19 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) && ff_pkt->statp.st_size > 0) || ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO) { + btimer_id tid; + if (ff_pkt->type == FT_FIFO) { + tid = start_thread_timer(pthread_self(), 60); + } else { + tid = NULL; + } if ((ff_pkt->fid = open(ff_pkt->fname, O_RDONLY | O_BINARY)) < 0) { ff_pkt->ff_errno = errno; Jmsg(jcr, M_NOTSAVED, -1, _(" Cannot open %s: ERR=%s.\n"), ff_pkt->fname, strerror(ff_pkt->ff_errno)); + stop_thread_timer(tid); return 1; } + stop_thread_timer(tid); } else { ff_pkt->fid = -1; } diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index beb60185dd..c9fc477d26 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -198,12 +198,21 @@ int create_file(void *jcr, char *fname, char *ofile, char *lname, } } if (type == FT_RAW || type == FT_FIFO) { + btimer_id tid; Dmsg1(200, "FT_RAW|FT_FIFO %s\n", ofile); mode = O_WRONLY | O_BINARY; + /* Timeout open() in 60 seconds */ + if (type == FT_FIFO) { + tid = start_thread_timer(pthread_self(), 60); + } else { + tid = NULL; + } if ((*ofd = open(ofile, mode)) < 0) { Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), ofile, strerror(errno)); + stop_thread_timer(tid); return CF_ERROR; } + stop_thread_timer(tid); return CF_EXTRACT; } Dmsg1(200, "FT_SPEC %s\n", ofile); diff --git a/bacula/src/lib/watchdog.c b/bacula/src/lib/watchdog.c index 214f45892d..a1c9146774 100755 --- a/bacula/src/lib/watchdog.c +++ b/bacula/src/lib/watchdog.c @@ -298,6 +298,9 @@ void stop_child_timer(btimer_id wid) */ void stop_thread_timer(btimer_id wid) { + if (!wid) { + return; + } Dmsg2(200, "Stop thread timer 0x%x for %d secs.\n", wid, wid->wait); stop_btimer(wid); } diff --git a/bacula/src/version.h b/bacula/src/version.h index fb1d7ebe23..574824762d 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.29" #define VSTRING "1" -#define DATE "20 January 2003" -#define LSMDATE "20Jan03" +#define DATE "22 January 2003" +#define LSMDATE "22Jan03" /* Debug flags */ #define DEBUG 1