]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix FD crash when the SD disk is full introduced with SDPacketCheck feature
authorAlain Spineux <alain@baculasystems.com>
Thu, 18 Mar 2021 09:23:53 +0000 (10:23 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
Description:
------------

The FD crash when the SD send back a message to the FD (for example when the disk is full)
This issue was introduced in 12.6.2 with SDPacketCheck feature

Workaround:
-----------

Set SDPacketCheck to some value in the bacula-fd.conf

Details:
--------

bnet_poll_manager cannot handle error msg from SD

- FD get a "3999 Failed append\n" in the hearbeat while jcr->sd_packet_mgr
  was already set to NULL

bacula/src/filed/heartbeat.c

index f57fa705dbd881b49839e9a26762078a389b20bc..e002797dd0029476ed4b88210ded93e3635d019d 100644 (file)
@@ -107,7 +107,11 @@ extern "C" void *sd_heartbeat_thread(void *arg)
             Dmsg2(100, "Got m=%d BNET_SIG %d from SD\n", m, sd->msglen);
          } else {
             Dmsg3(100, "Got m=%d msglen=%d bytes from SD. MSG=%s\n", m, sd->msglen, sd->msg);
-            jcr->sd_packet_mgr->recv(jcr, sd->msg); // Might be to ack a POLL request
+            if (jcr->sd_packet_mgr)
+            {
+               // Might be to ack a POLL request
+               jcr->sd_packet_mgr->recv(jcr, sd->msg);
+            }
          }
       }
       Dmsg2(200, "wait_intr=%d stop=%d\n", n, sd->is_stop());