Skip to content

chore: 修复库路径#1

Merged
watsonhaw5566 merged 8 commits into
masterfrom
chore_github_url
Jul 16, 2026
Merged

chore: 修复库路径#1
watsonhaw5566 merged 8 commits into
masterfrom
chore_github_url

Conversation

@watsonhaw5566

@watsonhaw5566 watsonhaw5566 commented Jul 15, 2026

Copy link
Copy Markdown
Owner
  • 修复库路径
  • 修复CI问题

Summary by CodeRabbit

  • New Features
    • Added an all-checks CI job that aggregates required checks and reports completion.
  • Bug Fixes
    • Updated prebuilt extension download sources and install script to use the latest distribution location.
    • Improved CI setup consistency for PHP quality/build jobs.
  • Documentation
    • Refreshed README download links to point to the current prebuilt binary location.
  • Chores
    • Removed obsolete Composer extension build metadata.
    • Applied formatting-only/refactoring changes across the codebase with no intended runtime behavior changes.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@watsonhaw5566, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3eb4154b-b8c3-4efa-a92c-ad497a270d38

📥 Commits

Reviewing files that changed from the base of the PR and between 10ffe16 and fdb6d77.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • rust/src/stats.rs
📝 Walkthrough

Walkthrough

The change updates CI aggregation, removes Composer extension metadata, redirects prebuilt binary downloads, and reformats PHP and Rust implementation code while preserving the described runtime behavior.

Changes

Release and runtime updates

Layer / File(s) Summary
CI validation aggregation
.github/workflows/ci.yml
PHP setup no longer disables extensions explicitly; metadata syntax checking remains, and an all-checks job waits for the three required jobs.
Release and extension configuration
composer.json, scripts/install.sh, README.md
Composer extension metadata is removed, while prebuilt binary references are updated to the new repository.
Source endings and module wiring
src/..., build.rs, rust/src/lib.rs, rust/src/php_api.rs, rust/src/websocket.rs
Closing lines, Rust imports, lint attributes, error construction, and module formatting are adjusted.
HTTP and PHP API flow
rust/src/http.rs, rust/src/php_api.rs
Socket setup, request parsing, accept-loop structure, and handler result handling are reformatted without changing the described fallback behavior.
Prefork runtime tracking
rust/src/runtime.rs
Child tracking, file-mtime comparison, respawn handling, and related initialization code are updated.
Stats and WebSocket handling
rust/src/stats.rs, rust/src/websocket.rs
Stats aggregation, RSS parsing, WebSocket message handling, and test formatting are adjusted.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: fixing the repository/download path used by the install and README instructions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore_github_url

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
rust/src/runtime.rs (1)

334-342: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Handle errors from try_wait to prevent zombie tracking.

If child.try_wait() returns an Err(e) (e.g., the child was reaped externally or an OS error occurred), the current wildcard _ arm pushes it back into kept. This can lead to an infinite loop of attempting to wait on a non-existent child process in future cycles without successfully restarting it.

Consider matching Ok(None) explicitly to keep the running child, and treating Err similarly to Ok(Some(_)) (by restarting it) to ensure resilience.

🛠️ Proposed fix
-        match child.try_wait() {
-            Ok(Some(_)) => {
-                to_restart.push(tracked.kind);
-            }
-            _ => {
-                kept.push(TrackedChild {
-                    kind: tracked.kind,
-                    child,
-                });
-            }
-        }
+        match child.try_wait() {
+            Ok(Some(_)) => {
+                to_restart.push(tracked.kind);
+            }
+            Ok(None) => {
+                kept.push(TrackedChild {
+                    kind: tracked.kind,
+                    child,
+                });
+            }
+            Err(e) => {
+                eprintln!("[lychee-worker] failed to wait on child (pid={}): {}", child.id(), e);
+                to_restart.push(tracked.kind);
+            }
+        }
🤖 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 `@rust/src/runtime.rs` around lines 334 - 342, Update the child handling match
around child.try_wait() to distinguish Ok(None) from errors: keep the child only
for Ok(None), while treating Err cases like Ok(Some(_)) by adding tracked.kind
to to_restart and not retaining the child in kept.
rust/src/http.rs (1)

93-96: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Prevent CPU spin on accept errors (e.g., EMFILE).

If the process runs out of available file descriptors, listener.accept() will immediately and repeatedly return an error (such as EMFILE or ENFILE). Without a delay, this causes the accept loop to spin instantly, pegging the CPU at 100% and flooding the logs.

Consider introducing a short sleep on error to allow the system time to recover before attempting to accept new connections.

🛠 Proposed fix
                     Err(e) => {
                         eprintln!("[lychee-worker] accept error: {}", e);
+                        tokio::time::sleep(std::time::Duration::from_millis(100)).await;
                     }
🤖 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 `@rust/src/http.rs` around lines 93 - 96, Update the accept error branch in the
listener loop to sleep briefly after logging an error, before retrying
listener.accept(). Reuse the module’s existing async/runtime sleep mechanism if
available, and preserve the current retry behavior for transient errors.
🤖 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 `@rust/src/websocket.rs`:
- Around line 100-101: Update the connection task around the reader and writer
JoinHandles to declare both handles mutable and use tokio::select! instead of
tokio::join!. When either reader or writer completes, explicitly abort the other
handle before returning so cleanup_connection runs and releases the connection
resources.

---

Nitpick comments:
In `@rust/src/http.rs`:
- Around line 93-96: Update the accept error branch in the listener loop to
sleep briefly after logging an error, before retrying listener.accept(). Reuse
the module’s existing async/runtime sleep mechanism if available, and preserve
the current retry behavior for transient errors.

In `@rust/src/runtime.rs`:
- Around line 334-342: Update the child handling match around child.try_wait()
to distinguish Ok(None) from errors: keep the child only for Ok(None), while
treating Err cases like Ok(Some(_)) by adding tracked.kind to to_restart and not
retaining the child in kept.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 398422b9-99fe-4ada-ab65-3086f9658c3b

📥 Commits

Reviewing files that changed from the base of the PR and between d6fb90a and 10ffe16.

📒 Files selected for processing (7)
  • build.rs
  • rust/src/http.rs
  • rust/src/lib.rs
  • rust/src/php_api.rs
  • rust/src/runtime.rs
  • rust/src/stats.rs
  • rust/src/websocket.rs

Comment thread rust/src/websocket.rs
Comment on lines +100 to +101
let _ = tokio::join!(reader, writer);
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Task deadlock and resource leak on client disconnect.

tokio::join!(reader, writer) waits for both spawned tasks to complete. If the client disconnects, the reader task finishes, but the writer task remains blocked indefinitely on rx.recv().await. Because the join! never returns, cleanup_connection is never called, meaning tx is never removed from the CONNECTIONS map and rx never closes. This permanently leaks the task and connection resources for every disconnected client.

Use tokio::select! so that when one task completes, the other is aborted. Note that dropping a Tokio JoinHandle does not automatically cancel the background task, so you must explicitly call .abort().

🛠 Proposed fix

Change the reader and writer variables to be mutable, and replace tokio::join! with tokio::select!:

-            let writer = tokio::task::spawn_local(async move {
+            let mut writer = tokio::task::spawn_local(async move {
// ...
-            let reader = tokio::task::spawn_local(async move {
+            let mut reader = tokio::task::spawn_local(async move {
// ...
-            let _ = tokio::join!(reader, writer);
+            tokio::select! {
+                _ = &mut reader => { writer.abort(); }
+                _ = &mut writer => { reader.abort(); }
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let _ = tokio::join!(reader, writer);
})
tokio::select! {
_ = &mut reader => {
writer.abort();
}
_ = &mut writer => {
reader.abort();
}
}
})
🤖 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 `@rust/src/websocket.rs` around lines 100 - 101, Update the connection task
around the reader and writer JoinHandles to declare both handles mutable and use
tokio::select! instead of tokio::join!. When either reader or writer completes,
explicitly abort the other handle before returning so cleanup_connection runs
and releases the connection resources.

@watsonhaw5566
watsonhaw5566 merged commit 28098e4 into master Jul 16, 2026
5 checks passed
@watsonhaw5566
watsonhaw5566 deleted the chore_github_url branch July 16, 2026 02:11
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.

1 participant