broker: fail the run loudly when the writer breaks mid-acquisition
A writer connection that dropped mid-run left a truncated file, yet the acquisition was still logged as "finished with success": the writer error returned by ImagePusher::Finalize() (set via transmission_error on a broken session connection) was captured into receiver_output.writer_err but never acted upon. Treat a non-empty writer_err as a failed acquisition: throw so it is reported as "finished with error" and surfaced to the caller, instead of silently succeeding with incomplete data. Applies to both the Lite and FPGA workflows, which share this stop/finalize path. Combined with the liveness changes (which no longer tear a connection down for a transient stall), this fires only on a genuine writer break. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,14 @@ JFJochServicesOutput JFJochServices::Stop() {
|
||||
ret.receiver_output.received_packets[i], ret.receiver_output.expected_packets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// A writer that broke mid-run (e.g. a lost connection) leaves a truncated file.
|
||||
// Surface that as a failed acquisition instead of silently reporting success.
|
||||
if (!ret.receiver_output.writer_err.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::FileWriteError,
|
||||
"Writer error, written data may be incomplete: "
|
||||
+ ret.receiver_output.writer_err);
|
||||
|
||||
logger.Info(" ... finished with success");
|
||||
} catch (const JFJochException &e) {
|
||||
logger.Error(" ... finished with error {}", e.what());
|
||||
|
||||
Reference in New Issue
Block a user