X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fappend.c;h=89953b466b066e6d136086025285b54cea0652c7;hb=c66d0785ff68244b8ce0b7ebb5817492448786c1;hp=eeae53420bd481965aec63da5ae870ba0f4ca95a;hpb=f2dfd500c0acf5ec87f363bc40cddf51b1c1ba7c;p=bacula%2Fbacula diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index eeae53420b..89953b466b 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -43,6 +43,7 @@ bool do_append_data(JCR *jcr) char buf1[100], buf2[100]; DCR *dcr = jcr->dcr; DEVICE *dev; + char ec[50]; if (!dcr) { @@ -79,7 +80,7 @@ bool do_append_data(JCR *jcr) if (dev->VolCatInfo.VolCatName[0] == 0) { Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n")); } - Dmsg1(20, "Begin append device=%s\n", dev->print_name()); + Dmsg1(50, "Begin append device=%s\n", dev->print_name()); begin_data_spool(dcr); begin_attribute_spool(jcr); @@ -204,8 +205,6 @@ bool do_append_data(JCR *jcr) if (!write_block_to_device(dcr)) { Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n", dev->print_name(), dev->bstrerror()); - Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); ok = false; break; } @@ -240,6 +239,7 @@ bool do_append_data(JCR *jcr) Dmsg0(650, "Enter bnet_get\n"); } Dmsg1(650, "End read loop with FD. Stat=%d\n", n); + if (is_bnet_error(ds)) { Dmsg1(350, "Network read error from FD. ERR=%s\n", bnet_strerror(ds)); Jmsg1(jcr, M_FATAL, 0, _("Network error on data channel. ERR=%s\n"), @@ -249,6 +249,16 @@ bool do_append_data(JCR *jcr) } } + time_t job_elapsed = time(NULL) - jcr->run_time; + + if (job_elapsed <= 0) { + job_elapsed = 1; + } + + Jmsg(dcr->jcr, M_INFO, 0, _("Job write elapsed time = %02d:%02d:%02d, Transfer rate = %s bytes/second\n"), + job_elapsed / 3600, job_elapsed % 3600 / 60, job_elapsed % 60, + edit_uint64_with_suffix(jcr->JobBytes / job_elapsed, ec)); + /* Create Job status for end of session label */ set_jcr_job_status(jcr, ok?JS_Terminated:JS_ErrorTerminated); @@ -284,6 +294,7 @@ bool do_append_data(JCR *jcr) if (!ok) { discard_data_spool(dcr); } else { + /* Note: if commit is OK, the device will remain locked */ commit_data_spool(dcr); } @@ -291,7 +302,10 @@ bool do_append_data(JCR *jcr) ok = dvd_close_job(dcr); /* do DVD cleanup if any */ } - /* Release the device -- and send final Vol info to DIR */ + /* + * Release the device -- and send final Vol info to DIR + * and unlock it. + */ release_device(dcr); if (!ok || job_canceled(jcr)) {