diff --git a/nativelink-service/src/bytestream_server.rs b/nativelink-service/src/bytestream_server.rs index 71b7eff7a..bb5ab6c91 100644 --- a/nativelink-service/src/bytestream_server.rs +++ b/nativelink-service/src/bytestream_server.rs @@ -556,7 +556,14 @@ impl ByteStreamServer { let has_fut = store_clone.has(digest); let Some(item_size) = has_fut.await.err_tip(|| "Failed to call .has() on store")? else { - return Err(make_err!(Code::NotFound, "{}", "not found")); + // We lie here and say that the stream needs to start over, even though + // it was never started. This can happen when the client disconnects + // before sending the first payload, but the client thinks it did send + // the payload. + return Ok(Response::new(QueryWriteStatusResponse { + committed_size: 0, + complete: false, + })); }; Ok(Response::new(QueryWriteStatusResponse { committed_size: item_size as i64, diff --git a/nativelink-service/tests/bytestream_server_test.rs b/nativelink-service/tests/bytestream_server_test.rs index 2b4d453ae..9d1124d29 100644 --- a/nativelink-service/tests/bytestream_server_test.rs +++ b/nativelink-service/tests/bytestream_server_test.rs @@ -866,19 +866,21 @@ pub async fn test_query_write_status_smoke_test() -> Result<(), Box::into(response.unwrap_err()), expected_err); } // Setup stream.