Summary
DeleteResult should invalidate all active chunked-result download sessions associated with the deleted job.
Rationale
StartChunkedDownload snapshots completed result arrays into chunked_downloads. Deleting the job currently removes the tracker entry, pending data, and log file, but a client that already holds a download_id can continue retrieving the snapshotted result. This leaves deleted job data accessible and resident until the download session is finished or expires.
Affected areas
cpp/src/grpc/server/grpc_service_impl.cpp
StartChunkedDownload
GetResultChunk
- download-session lifecycle coordination
cpp/src/grpc/server/grpc_job_management.cpp
cpp/src/grpc/server/grpc_server_types.hpp
- any required download-session metadata or lifecycle declarations
- gRPC integration tests covering
DeleteResult and chunked downloads
Required changes
- Associate each
ChunkedDownloadState entry with its originating job_id.
- During
delete_job, remove every matching download session while holding chunked_downloads_mutex.
- Coordinate
StartChunkedDownload and deletion so that no session can be created after deletion completes, including concurrent requests.
- Ensure subsequent
GetResultChunk calls for an invalidated download_id return the existing unknown-download/not-found behavior.
- Add integration coverage for deleting a job with an active chunked download and for the creation/deletion race.
Acceptance criteria
- After a successful
DeleteResult, no active chunked-download session remains for that job.
- A previously issued
download_id cannot return any further result data after deletion.
- Concurrent
StartChunkedDownload and DeleteResult cannot leave a usable session for a deleted job.
- Existing chunked-download behavior for non-deleted jobs remains unchanged.
Backlinks
Summary
DeleteResultshould invalidate all active chunked-result download sessions associated with the deleted job.Rationale
StartChunkedDownloadsnapshots completed result arrays intochunked_downloads. Deleting the job currently removes the tracker entry, pending data, and log file, but a client that already holds adownload_idcan continue retrieving the snapshotted result. This leaves deleted job data accessible and resident until the download session is finished or expires.Affected areas
cpp/src/grpc/server/grpc_service_impl.cppStartChunkedDownloadGetResultChunkcpp/src/grpc/server/grpc_job_management.cppdelete_jobcleanup pathcpp/src/grpc/server/grpc_server_types.hppDeleteResultand chunked downloadsRequired changes
ChunkedDownloadStateentry with its originatingjob_id.delete_job, remove every matching download session while holdingchunked_downloads_mutex.StartChunkedDownloadand deletion so that no session can be created after deletion completes, including concurrent requests.GetResultChunkcalls for an invalidateddownload_idreturn the existing unknown-download/not-found behavior.Acceptance criteria
DeleteResult, no active chunked-download session remains for that job.download_idcannot return any further result data after deletion.StartChunkedDownloadandDeleteResultcannot leave a usable session for a deleted job.Backlinks