Skip to content

feat(clp-tdl-package): Implement the clp-s S3 compression task. - #2411

Merged
LinZhihao-723 merged 19 commits into
y-scope:mainfrom
LinZhihao-723:compress-task-impl
Jul 28, 2026
Merged

feat(clp-tdl-package): Implement the clp-s S3 compression task.#2411
LinZhihao-723 merged 19 commits into
y-scope:mainfrom
LinZhihao-723:compress-task-impl

Conversation

@LinZhihao-723

@LinZhihao-723 LinZhihao-723 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

This PR depends on #2406.

This PR fills in the compression task registered by clp-tdl-package: it compresses one partition of S3 objects into single-file archives with clp-s, indexes each archive, and uploads it to S3, returning the archives' metadata for the commit task. This is the worker behind the compression::clp_s_s3_compress TDL task; the commit task remains unimplemented.

Compression flow

compress mirrors the Python compression task:

  • Writes the S3 object URLs to a --files-from list file in the tmp directory.
  • Runs clp-s with --print-archive-stats, streaming each archive's stats line off stdout as it is produced.
  • For each reported archive, spawns a finisher that concurrently uploads it to S3 (put_object) and runs the indexer over it, then the staged copy is cleaned up.

Archives are streamed rather than collected up front so uploads and indexing overlap clp-s still running, and the finishers are drained before the task returns so no work is abandoned. The first finisher error (or a clp-s failure) fails the task.

Unstructured (log-converter) input

Structured (JSON) input is compressed directly from S3. Unstructured text input is first converted by log-converter into a local directory that clp-s then compresses, selected by the unstructured flag on the task's clp-s options. Following the Python task, the unstructured path drops S3 auth from the clp-s invocation (it reads the local converted files, not S3) and pins the timestamp key to timestamp; only log-converter carries the S3 credentials in that case.

Subprocess I/O

Both child processes capture stderr so it can be surfaced on failure. clp-s pipes both stdout and stderr, so its stderr is drained on a dedicated thread to avoid a pipe-buffer deadlock while stdout is streamed, and it is killed and reaped before an error is returned. log-converter discards stdout (/dev/null) and has only a single stderr pipe, so a straight read-to-EOF-then-wait is deadlock-free there; the wait is issued unconditionally so the child is always reaped even if reading its stderr fails.

Temp-file cleanup

TmpFileDeleter registers the list file, the converted directory, and each archive's staging path, and deletes them all when compress returns — on success or on any early error. Deletion is sequential and blocking (a handful of local paths, unlink has no async form, and a destructor cannot be async), and a path that cannot be deleted is logged as a warning rather than propagated.

Observability

Each stage logs structured tracing events; every subprocess or S3 failure is logged with its captured context (exit status, stderr, archive id, S3 key) at the point it occurs.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Ensure all workflows pass
  • Exercised compress end-to-end (outside Spider) against clp-s, indexer, and log-converter from build/core, a local MariaDB, and a real S3 bucket, with a JSON tracing subscriber capturing logs. Each scenario asserts the return value, the S3 side effect, and that the tmp directory is left clean:
Scenario Input Output Logging Tmp dir
Structured JSON S3 object of JSON records, unstructured: false Ok with the produced archive's metadata; the archive object is present in S3 under <key_prefix>/<dataset>/<archive_id>; the dataset's column_metadata table gains rows (indexer ran) started + completed successfully info lines list file removed
Unstructured text S3 object of plaintext logs, unstructured: true Ok with archive metadata; archive object present in S3 (log-converter ran before clp-s, which compressed the local converted directory) started + completed successfully info lines list file and the -converted directory removed
Metadata DB unreachable valid input, DB port pointed at a closed port Err (indexer exits non-zero) error line indexer exited on failure. with status + archive_path cleaned
Missing S3 object object_keys referencing a non-existent S3 key Err (clp-s exits non-zero) error line clp-s exited on failure. with the captured clp-s stderr (S3 read, 404) cleaned
Invalid S3 credentials valid input, wrong secret access key Err (clp-s exits non-zero on the credential path forwarded to the child) error line clp-s exited on failure. with the captured clp-s stderr (S3 read, 403) cleaned
Malformed input content readable S3 object of invalid JSONL, valid credentials Err (clp-s exits non-zero) error line clp-s exited on failure. with the captured clp-s stderr (JSON parse error, after the object was read) cleaned

Note: surfaced by the DB-unreachable and malformed-content cases: because a finisher uploads to S3 and runs the indexer concurrently, once an archive is produced its S3 upload is not rolled back if the indexer (or the overall task) then fails. A failed task can thus leave an orphan archive object in S3 (local staging is still cleaned up); the object has no metadata row, so it is invisible to the commit task and left to retention/GC. This is a known behavior and will be addressed in the future.

Summary by CodeRabbit

  • New Features
    • Added task support for compressing data from Amazon S3.
    • Supports both structured and unstructured log inputs, including automatic conversion where required.
    • Archives are uploaded to S3 and indexed as they are produced.
    • Compression results now include archive statistics and improved error reporting.
  • Known Limitations
    • The compression commit task is not yet available.

The initial and maximum job-state poll backoffs were fixed constants inside the
Spider implementation, so a caller had no way to tune how aggressively a job is
polled. Both are now `Duration` parameters of
`run_s3_compression_job_to_completion`, leaving the pacing decision with the
caller that knows how long its jobs typically run.
…asks need:

* Add `ArchiveOutputStorage` and the archive output's `storage` and `retention_period` fields.
* Add `Database`'s fixed `table_prefix`.
* Fill in `SpiderTaskExecutorConfig` and resolve its relative paths against `CLP_HOME`.
* Add `resolve_dataset_name` and the default dataset name.
* Add `generate_s3_url`.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Changes

Adds the clp-tdl-package Rust crate and implements Spider TDL S3 compression tasks. The worker supports structured and unstructured inputs, runs CLP tools, uploads archives to S3, indexes results, handles failures, and returns archive metadata. The commit task remains unimplemented.

CLP TDL compression

Layer / File(s) Summary
Package manifest and compression contracts
components/clp-tdl-package/Cargo.toml, components/clp-tdl-package/src/task/compression/compress.rs
Adds crate metadata, dependencies, compression-flow structures, and temporary-path cleanup.
S3 input and CLI preparation
components/clp-tdl-package/src/task/compression/compress.rs
Builds S3 inputs and credentials, converts unstructured logs, validates S3 output, and constructs tool arguments.
Compression execution and archive finalization
components/clp-tdl-package/src/task/compression/compress.rs
Runs clp-s, parses archive statistics, uploads archives, invokes indexer, handles failures, and tests helper behaviour.
Compression task entrypoints
components/clp-tdl-package/src/task/compression/mod.rs
Registers compression and commit tasks; compression errors become TDL execution errors, while commit remains unimplemented.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SpiderTask
  participant compress
  participant clp-s
  participant ArchiveFinisher
  participant S3
  participant indexer
  SpiderTask->>compress: invoke S3 compression task
  compress->>clp-s: run compression
  clp-s-->>compress: emit archive statistics
  compress->>ArchiveFinisher: schedule archive finalization
  ArchiveFinisher->>S3: upload archive
  ArchiveFinisher->>indexer: index archive
  ArchiveFinisher-->>compress: return completion result
  compress-->>SpiderTask: return compression output
Loading

Possibly related PRs

  • y-scope/clp#2401: Introduces the compression types consumed by this S3 compression worker.
  • y-scope/clp#2402: Builds task graphs targeting the compression task names added here.
  • y-scope/clp#2415: Implements the commit worker corresponding to the placeholder task added here.

Suggested reviewers: jackluo923

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds S3 compression work, but issue #39 asks to remove the unused OnDiskFile class. Remove the unused OnDiskFile class and its references, or split the compression work into a separate PR.
Out of Scope Changes check ⚠️ Warning The changes are unrelated to issue #39 and introduce a new compression task instead of OnDiskFile cleanup. Move the compression implementation to a separate PR and keep this one limited to the OnDiskFile removal.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: implementing the clp-s S3 compression task in clp-tdl-package.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sitaowang1998 sitaowang1998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with clp s3 details, so I assume that the overall algorithm is correct during my review.

Comment thread components/clp-tdl-package/src/task/compression/compress.rs Outdated
Comment thread components/clp-tdl-package/src/task/compression/compress.rs
credential_env: Vec<(&'static str, String)>,
tmp_file_deleter: &mut TmpFileDeleter,
) -> anyhow::Result<(ClpSInput, Vec<(&'static str, String)>)> {
if !clp_s_option.unstructured {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really in scope of this review, but we should avoid using boolean flag here. I understand that for serialization a boolean is needed, but that should be a serialization details, hidden from user-facing code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I'm not sure I fully understand. Can you elaborate on the desired interface?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If should be an enum.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I know this is out of the scope for this PR. But I'm not sure if we really need an enum for this. If we use a binary flag to determine whether the input source is from s3, for example, is_from_s3, which differs from "from filesystem", then I think it would be a good practice to define an enum for it, even it only has two options. However, if an option is purely a binary flag of two opposite concepts like "structured" and "unstructured", I don't really see the benefit of using an enum. You can even match this flag like match unstructured { true => xxx, false => xxx, } with the readability preserved. So I'd argue that using a binary flag for this case should be sufficient.

Comment thread components/clp-tdl-package/src/task/compression/compress.rs Outdated
Comment thread components/clp-tdl-package/src/task/compression/compress.rs Outdated
@LinZhihao-723

Copy link
Copy Markdown
Member Author

I am not familiar with clp s3 details, so I assume that the overall algorithm is correct during my review.

Added the scenarios I've tested in the PR description.

@LinZhihao-723
LinZhihao-723 marked this pull request as ready for review July 22, 2026 02:43
@LinZhihao-723
LinZhihao-723 requested a review from a team as a code owner July 22, 2026 02:43
sitaowang1998
sitaowang1998 previously approved these changes Jul 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/clp-rust-utils/src/s3/url.rs`:
- Around line 1-27: Update generate_s3_url to percent-encode object_key before
composing either endpoint or AWS URLs, preserving each slash as a path separator
while encoding spaces, reserved characters, percent signs, and non-ASCII bytes.
Reuse an appropriate URL/path encoding utility and apply the encoded key in all
URL construction branches.

In `@components/clp-tdl-package/Cargo.toml`:
- Line 16: Update the spider-tdl dependency declaration to use a fixed reviewed
git revision via rev, or a specific published version, instead of branch =
"main"; preserve the existing derive feature and dependency source.

In `@components/clp-tdl-package/src/task/compression/mod.rs`:
- Around line 30-33: Update the compression::commit commit_task implementation
so it no longer unconditionally panics via unimplemented!. Before retaining its
registration, either implement the task, return an explicit TdlError execution
failure, or remove compression::commit from the package task list until it is
ready.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d31a0634-1652-4a3b-a07d-4a1de125e030

📥 Commits

Reviewing files that changed from the base of the PR and between be26c83 and e1c426c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • Cargo.toml
  • components/clp-rust-utils/src/clp_config/package/config.rs
  • components/clp-rust-utils/src/dataset.rs
  • components/clp-rust-utils/src/s3.rs
  • components/clp-rust-utils/src/s3/url.rs
  • components/clp-rust-utils/src/task_io/compression.rs
  • components/clp-tdl-package/Cargo.toml
  • components/clp-tdl-package/src/common.rs
  • components/clp-tdl-package/src/lib.rs
  • components/clp-tdl-package/src/task/compression/commit.rs
  • components/clp-tdl-package/src/task/compression/compress.rs
  • components/clp-tdl-package/src/task/compression/mod.rs
  • components/clp-tdl-package/src/task/mod.rs
  • taskfile.yaml

Comment on lines +1 to +27
/// Generates the URL of an S3 object.
///
/// When `endpoint_url` is set, a path-style URL rooted at that endpoint is produced and
/// `region_code` is ignored, since the endpoint already fully specifies the host. Otherwise, a
/// virtual-hosted-style URL against the default AWS endpoint is produced, incorporating
/// `region_code` when it is set.
///
/// # Returns
///
/// The generated object URL.
#[must_use]
pub fn generate_s3_url(
endpoint_url: Option<&str>,
region_code: Option<&str>,
bucket: &str,
object_key: &str,
) -> String {
endpoint_url.map_or_else(
|| {
region_code.map_or_else(
|| format!("https://{bucket}.s3.amazonaws.com/{object_key}"),
|region| format!("https://{bucket}.s3.{region}.amazonaws.com/{object_key}"),
)
},
|endpoint| format!("{}/{bucket}/{object_key}", endpoint.trim_end_matches('/')),
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

clp-s clp-core --files-from S3 URL format object key encoding

💡 Result:

When working with CLP (Compressed Log Processor) tools like clp-s and the associated S3 compression scripts, the expected S3 URL formats are standard virtual-hosted or path-style URL structures [1]. S3 URL Formats: The tools accept S3 locations in either of these two formats [1]: 1. Virtual-hosted style: https://.s3..amazonaws.com/ 2. Path-style: https://s3..amazonaws.com// Using --files-from (or --inputs-from): The --inputs-from flag (often used in the sbin/compress-from-s3.sh script) accepts a path to a text file that contains one S3 object URL per line, adhering to the formats listed above [1][2]. Object Key Encoding: CLP commands that accept URLs, such as clp-s, treat these inputs as network resources [3][4]. When authentication is enabled (via --auth s3), the tools issue GET requests following the AWS Signature Version 4 specification [3][4]. While CLP itself handles the network requests, it generally expects the object keys provided in the URL to follow standard URL encoding if they contain special characters (such as spaces or non-ASCII characters) to ensure compatibility with HTTP transport protocols and AWS S3 API requirements. Authentication: When using URLs, ensure that the environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and (optionally) AWS_SESSION_TOKEN are properly set in your environment, as the tools rely on these for AWS Signature Version 4 authentication [3][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== url.rs ==\n'
sed -n '1,200p' components/clp-rust-utils/src/s3/url.rs

printf '\n== compress.rs references ==\n'
rg -n "generate_s3_url|files-from|inputs-from|s3 url|S3" components/clp-tdl-package/src/task/compression/compress.rs components/clp-rust-utils -g '!target'

printf '\n== tests referencing generate_s3_url ==\n'
rg -n "generate_s3_url|s3.amazonaws.com|endpoint_url|region_code" components -g '!target'

Repository: y-scope/clp

Length of output: 30689


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Rust compression flow around build_s3_logs_list ==\n'
sed -n '300,340p' components/clp-tdl-package/src/task/compression/compress.rs

printf '\n== Python S3 URL generation/parsing ==\n'
sed -n '257,290p' components/clp-py-utils/clp_py_utils/s3_utils.py
sed -n '220,255p' components/clp-py-utils/clp_py_utils/s3_utils.py

printf '\n== Any explicit URL parsing/decoding in Rust S3 code ==\n'
rg -n "parse_s3_url|url::Url|percent|decode|encode|object_key" components/clp-rust-utils/src components/clp-tdl-package/src -g '!target'

Repository: y-scope/clp

Length of output: 6872


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== S3InputSource definition ==\n'
sed -n '1,120p' components/clp-rust-utils/src/task_io/compression.rs

printf '\n== build_s3_logs_list tests and fixture data ==\n'
sed -n '820,880p' components/clp-tdl-package/src/task/compression/compress.rs

printf '\n== any object key validation/sanitization ==\n'
rg -n "object_keys|key_prefix|sanitize|encode|percent|urlencoding|Url::parse|parse\(" components/clp-rust-utils/src components/clp-tdl-package/src components/clp-py-utils/clp_py_utils -g '!target'

Repository: y-scope/clp

Length of output: 11315


Percent-encode S3 object keys before composing the URL. object_key is inserted raw into the path, so valid keys containing spaces, #, ?, %, or non-ASCII characters can turn into malformed or ambiguous URLs in the --files-from list. Preserve / as a path separator while encoding the rest.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-rust-utils/src/s3/url.rs` around lines 1 - 27, Update
generate_s3_url to percent-encode object_key before composing either endpoint or
AWS URLs, preserving each slash as a path separator while encoding spaces,
reserved characters, percent signs, and non-ASCII bytes. Reuse an appropriate
URL/path encoding utility and apply the encoded key in all URL construction
branches.

Comment thread components/clp-tdl-package/Cargo.toml
Comment thread components/clp-tdl-package/src/task/compression/mod.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
components/clp-tdl-package/src/task/compression/compress.rs (4)

884-904: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for empty S3 object keys.

This change introduces an error path for empty keys, but the test exercises only valid keys. Add a case with object_keys: vec![String::new()] and assert that build_s3_logs_list fails.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-tdl-package/src/task/compression/compress.rs` around lines 884
- 904, Extend the build_s3_logs_list_default_endpoint test coverage with an
input_source whose object_keys contains an empty String, then assert that
build_s3_logs_list returns an error for that case.

80-89: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Register the temporary list before writing it.

If std::fs::write creates a partial file and then fails, the ? returns before list_path is added to TmpFileDeleter, leaving temporary data behind. Build the list first, register the path, then write it; also treat a missing path as a normal cleanup outcome.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-tdl-package/src/task/compression/compress.rs` around lines 80
- 89, Update the temporary S3 logs list flow around build_s3_logs_list,
list_path, and TmpFileDeleter: build the list contents first, register list_path
before calling std::fs::write, and make cleanup treat a missing path as a normal
outcome. Preserve the existing write context and error logging while ensuring
partial files are removed when writing fails.

121-138: 🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift

Bound concurrent archive finalisation and stream uploads.

Every archive immediately spawns a finisher, while upload_file_to_s3 (Line [588-615]) reads the complete archive into memory. A large partition can therefore queue unbounded work and retain multiple archive-sized buffers, causing severe memory pressure or OOM. Use a semaphore/bounded queue and stream or otherwise cap upload buffering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-tdl-package/src/task/compression/compress.rs` around lines 121
- 138, Bound archive finalization concurrency in the archive_callback flow using
a semaphore or bounded queue, and ensure upload_file_to_s3 does not retain
unbounded archive-sized buffers by streaming uploads or applying an equivalent
buffer cap. Preserve archive processing while limiting the number of concurrent
finishers and stream uploads.

262-284: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Prevent inconsistent S3 and index state.

tokio::join! publishes upload and indexing concurrently and only checks their results after both have finished. If run_indexer commits indexing state while upload_file_to_s3 later fails, this job reports failure despite visible search metadata for an archive without the archive object; the opposite failure can leave an orphaned S3 object. Make publishing atomic by ordering it (index after upload, or upload after index) or adding compensation/reconciliation that rolls back either side.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-tdl-package/src/task/compression/compress.rs` around lines 262
- 284, Replace the concurrent tokio::join! flow around upload_file_to_s3 and
index with an ordered or compensating publication flow so S3 and indexing cannot
remain inconsistent. Ensure indexing occurs only after a successful upload, or
roll back the upload if indexing fails; preserve the existing error context and
logging for both operations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/clp-tdl-package/src/task/compression/compress.rs`:
- Around line 884-904: Extend the build_s3_logs_list_default_endpoint test
coverage with an input_source whose object_keys contains an empty String, then
assert that build_s3_logs_list returns an error for that case.
- Around line 80-89: Update the temporary S3 logs list flow around
build_s3_logs_list, list_path, and TmpFileDeleter: build the list contents
first, register list_path before calling std::fs::write, and make cleanup treat
a missing path as a normal outcome. Preserve the existing write context and
error logging while ensuring partial files are removed when writing fails.
- Around line 121-138: Bound archive finalization concurrency in the
archive_callback flow using a semaphore or bounded queue, and ensure
upload_file_to_s3 does not retain unbounded archive-sized buffers by streaming
uploads or applying an equivalent buffer cap. Preserve archive processing while
limiting the number of concurrent finishers and stream uploads.
- Around line 262-284: Replace the concurrent tokio::join! flow around
upload_file_to_s3 and index with an ordered or compensating publication flow so
S3 and indexing cannot remain inconsistent. Ensure indexing occurs only after a
successful upload, or roll back the upload if indexing fails; preserve the
existing error context and logging for both operations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a561bddb-9791-412f-8172-72722c3537f3

📥 Commits

Reviewing files that changed from the base of the PR and between 749e9cc and 7106e95.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • components/clp-tdl-package/src/task/compression/compress.rs

@LinZhihao-723
LinZhihao-723 merged commit 26abf13 into y-scope:main Jul 28, 2026
28 checks passed
@LinZhihao-723
LinZhihao-723 deleted the compress-task-impl branch July 28, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants