diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-09 10:08:39 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-09 23:15:05 +0200 |
| commit | 767238a8abebbb2a2f8d1e91806131754b9c67fd (patch) | |
| tree | 599fdab7bdb7828d84a5f11634d46fadff3c51fc | |
| parent | b50a098f422cdb671a67ccb41e2837aa505e405b (diff) | |
Add more logging to disk writer.
| -rw-r--r-- | src/lib/copy_to_drive_job.cc | 1 | ||||
| -rw-r--r-- | src/lib/nanomsg.cc | 1 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 10 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/copy_to_drive_job.cc b/src/lib/copy_to_drive_job.cc index 96f873cf6..9ddedfe62 100644 --- a/src/lib/copy_to_drive_job.cc +++ b/src/lib/copy_to_drive_job.cc @@ -67,6 +67,7 @@ CopyToDriveJob::run () { LOG_DISK("Sending write request to disk writer for %1 %2", _dcp.string(), _drive.device()); if (!_nanomsg.send(String::compose(DISK_WRITER_WRITE "\n%1\n%2\n", _dcp.string(), _drive.device()), 2000)) { + LOG_DISK_NC("Failed to send write request."); throw CommunicationFailedError (); } diff --git a/src/lib/nanomsg.cc b/src/lib/nanomsg.cc index b66d966af..1180f6936 100644 --- a/src/lib/nanomsg.cc +++ b/src/lib/nanomsg.cc @@ -99,6 +99,7 @@ Nanomsg::recv_and_parse (int flags) return; } + LOG_DISK_NC("nn_recv failed"); throw CommunicationFailedError (); } diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index a3b351c85..0a53a0a9b 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -251,10 +251,15 @@ private: bool have_writer = true; if (!_nanomsg.send(DISK_WRITER_PING "\n", 2000)) { + LOG_DISK_NC("Could not send ping to writer"); have_writer = false; } else { auto reply = _nanomsg.receive (2000); - if (!reply || *reply != DISK_WRITER_PONG) { + if (!reply) { + LOG_DISK_NC("No reply received from ping"); + have_writer = false; + } else if (*reply != DISK_WRITER_PONG) { + LOG_DISK_NC("Unexpected response to ping received"); have_writer = false; } } @@ -270,6 +275,7 @@ private: m->Destroy (); return; #else + LOG_DISK_NC ("Failed to ping writer"); throw CommunicationFailedError (); #endif } @@ -285,9 +291,11 @@ private: LOG_DISK("Sending unmount request to disk writer for %1", drive.as_xml()); if (!_nanomsg.send(DISK_WRITER_UNMOUNT "\n", 2000)) { + LOG_DISK_NC("Failed to send unmount request."); throw CommunicationFailedError (); } if (!_nanomsg.send(drive.as_xml(), 2000)) { + LOG_DISK_NC("Failed to send drive for unmount request."); throw CommunicationFailedError (); } /* The reply may have to wait for the user to authenticate, so let's wait a while */ |
