You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR Review: fix: runner alloc idx logic, api auth for actor get
Good set of targeted fixes. A few things worth discussing.
Potential Bug: Inconsistent Eviction Paths in tunnel_to_ws_task.rs
The PR introduces LifecycleResult::Evicted so that subscription-based eviction (eviction_sub.next()) skips ClearIdx. However, message-based eviction via ToRunnerClose / ToClientClose in handle_message_mk1/mk2 still returns Err(WsError::Eviction.build()) and was not converted (lines 126 and 220 of tunnel_to_ws_task.rs).
In lib.rs, only Ok(LifecycleResult::Evicted) skips ClearIdx — an Err(WsError::Eviction) falls through the else branch and still runs ClearIdx. So message-based eviction (ToRunnerClose) still triggers ClearIdx, while subscription-based eviction does not. Is this intentional? If both represent the same conceptual eviction (new connection taking over), they should behave consistently.
Security: Auth Bypass Scope in list.rs
The auth bypass allows any unauthenticated caller who knows an actor ID or name+key to read actor state. The intent (actors reading their own state) makes sense, but there is no verification that the requester is the actor being queried — any entity with a known actor ID can read its state. This may be acceptable if actor IDs are treated as secrets/capabilities, but worth a comment explaining the security model. If actor IDs are not confidential (e.g., returned in public responses or logged), this could be an info-disclosure path.
Minor: Condition Semantic Change in update_alloc_idx.rs
Old condition: tx.exists(&old_alloc_key) — only update if the runner was already in the index.
New condition: !draining — update if not draining, regardless of whether the runner was in the index.
This could cause the alloc index to be written for runners that were never added to it. If UpdatePing is only ever sent for already-indexed runners this is fine — just flagging the semantic difference.
Nit: Missing Newline at End of File
engine/artifacts/errors/serverless_runner_pool.failed_to_fetch_metadata.json is missing a trailing newline.
Looks Good
Removing the spurious ExpiredTsKey write on Draining in both runner.rs and runner2.rs is clearly correct.
Reading DrainTsKey in the same batch as ExpiredTsKey is a cleaner approach.
The LifecycleResult::Evicted variant adds clarity to the subscription-based eviction path.
The notification warning log in mark_eligible improves observability.
The db_path=%db_path.display() logging fix follows the structured logging convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: