diff --git a/src/client/client_send.c b/src/client/client_send.c index fe6dcdf..1ab04dd 100644 --- a/src/client/client_send.c +++ b/src/client/client_send.c @@ -1456,9 +1456,12 @@ static int send_chunks_multithreaded(void* pipeline_context) { context->scan_stopped_early = context->scan_stopped_early || stop_condition_reached(&context->stop_condition); if (context->scan_stopped_early) { - log_message(LOG_LEVEL_WARNING, - "transfer stopped early (stop deadline); skipping --delete keep-set so " - "unscanned source mirrors are not deleted"); + if (context->config->use_delete || context->config->delete_missing_args) + log_message(LOG_LEVEL_WARNING, + "transfer stopped early (stop deadline); skipping --delete keep-set so " + "unscanned source mirrors are not deleted"); + else + log_message(LOG_LEVEL_WARNING, "transfer stopped early (stop deadline)"); } else if (context->config->use_delete && !context->early_delete) { /* Empty keep-set + scan I/O error must not delete the whole destination (the source may not be genuinely empty -- see send_files). */ @@ -1911,9 +1914,12 @@ int send_files(Config* config) { loss), so the late delete manifest is suppressed below. */ scan_stopped_early = scan_stopped_early || stop_condition_reached(&stop); if (scan_stopped_early) { - log_message(LOG_LEVEL_WARNING, - "transfer stopped early (stop deadline); skipping --delete keep-set so " - "unscanned source mirrors are not deleted"); + if (config->use_delete || config->delete_missing_args) + log_message(LOG_LEVEL_WARNING, + "transfer stopped early (stop deadline); skipping --delete keep-set so " + "unscanned source mirrors are not deleted"); + else + log_message(LOG_LEVEL_WARNING, "transfer stopped early (stop deadline)"); } else { if (had_scan_io && manifest && manifest->size == 0) { /* A scan that hit an I/O error and produced no keep entries is ambiguous; diff --git a/src/shared/multiprocessing.c b/src/shared/multiprocessing.c index a77ffb6..d45b569 100644 --- a/src/shared/multiprocessing.c +++ b/src/shared/multiprocessing.c @@ -31,6 +31,7 @@ PipelineContextSender* pipeline_context_sender_create(Config* config, Queue* que context->scan_had_io_error = false; context->remove_source_files = NULL; context->early_delete = false; + context->scan_stopped_early = false; context->total_files = 0; context->progress_bytes = 0; context->total_bytes = 0; diff --git a/tests/integration/test_stop.py b/tests/integration/test_stop.py index 148fe87..f2bdc35 100644 --- a/tests/integration/test_stop.py +++ b/tests/integration/test_stop.py @@ -172,7 +172,7 @@ class TestStopPartial: run returns 0 without corrupting any file.""" source, dest = _make("partial") _seed_many(source, count=60, size=32 * 1024) - flags = ["--chunk-size", "262144", "--bwlimit", "300", "--stop-at=now+3s"] + flags = ["--chunk-size", "262144", "--bwlimit", "100", "--stop-at=now+3s"] result, _ = run_client(source, dest, flags=flags, port=shared_server.port) assert result.returncode == 0, \ f"mid-transfer stop failed (rc {result.returncode}): " \