Skip to content

feat: Provide ApiContext to externally registered tasks - #1307

Merged
c-thiel merged 13 commits into
mainfrom
ct/register-tasks-interior-mutability
Aug 27, 2025
Merged

c-thiel merged 13 commits into
mainfrom
ct/register-tasks-interior-mutability

Conversation

@c-thiel

@c-thiel c-thiel commented Aug 26, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Improvements
    • Task queues are now concurrency-safe and fully asynchronous; registration, discovery, and runners await operations and error messages list existing queues. Shutdown logs include queue names.
  • Refactor
    • Routing and server wiring unified around a single application state/context; background services and lifecycle are coordinated via the shared state.
  • Documentation
    • OpenAPI/Swagger now incorporates current task-queue configs.
  • Tests
    • Test harness and cases updated for async initialization and queue handling.

@coderabbitai

coderabbitai Bot commented Aug 26, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Convert task-queue subsystem to async with shared interior mutability (Arc), propagate awaits across serve, router, management endpoints, and tests; unify wiring around ApiContext<State<...>>; introduce generic async registration hooks and BoxFuture-based background-service/task-queue registrars.

Changes

Cohort / File(s) Summary
Task queue core (async + interior mutability)
crates/lakekeeper/src/service/task_queue/mod.rs, crates/lakekeeper/src/service/task_queue/*
Replace internal HashMap fields with Arc<RwLock<HashMap<...>>>; make registry/query APIs async (register_queue, register_built_in_queues, task_queues_runner, len, is_empty, queue_names, api_config, validate_config_fn); switch to tokio_util::sync::CancellationToken; remove pub use crate::CancellationToken; update tests and use .read().await/.write().await.
Serve wiring → ApiContext<State<...>> (generics)
crates/lakekeeper/src/serve.rs
Add RegisterTaskQueueFn<A,C,S> and RegisterBackgroundServiceFn<A,C,S> (Arc'd async fns returning BoxFuture); make ServeConfiguration generic and accept Vec of those fns; construct/pass ApiContext<State<A,C,S>> to registrations and router; add cancellation/shutdown wiring; await task-queue ops and background service registration.
Router refactor (single state field, async router)
crates/lakekeeper/src/api/router.rs
RouterArgs now carries state: ApiContext<State<...>>; new_full_router becomes async, derives authz from state.v1_state.authz, awaits state.v1_state.registered_task_queues.api_config() for OpenAPI merge, and removes prior separate wiring fields and imports. Debug/output and public surface updated accordingly.
Management endpoints (await queue ops, sorted names)
crates/lakekeeper/src/api/management/v1/bootstrap.rs, crates/lakekeeper/src/api/management/v1/warehouse/mod.rs
Await RegisteredTaskQueues::queue_names() and validate_config_fn(...); sort (sort_unstable) and/or join queue names before mapping/embedding in ServerInfo or error messages; update call sites to async.
Tests & test helpers made async / updated call sites
crates/lakekeeper/src/tests/mod.rs, crates/lakekeeper/src/tests/*.rs, crates/lakekeeper/src/catalog/views.rs, crates/lakekeeper/src/tests/drop_warehouse.rs, crates/lakekeeper/src/tests/stats.rs, crates/lakekeeper/src/tests/tasks.rs
Convert test helpers (get_api_context, spawn_build_in_queues) to async fn and await them; update call sites to .await; await register_queue, register_built_in_queues, task_queues_runner; adjust transaction begin to .await.unwrap() where surfaced.
Misc public-surface & config tweaks
Cargo.toml, multiple import/export sites
Enable derive_more debug feature; update public type signatures and Debug output for RouterArgs/ServeConfiguration; add/export State usage in ApiContext types.
Small behavior/log message change
crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs
Include queue name in graceful shutdown log message (literal changed).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Serve as serve()
  participant Reg as TaskQueueRegistry
  participant State as ApiContext<State<...>>
  participant SQ as RegisteredTaskQueues
  participant Router as new_full_router
  participant BG as BackgroundServices

  Serve->>Reg: register_built_in_queues(...)\n(await)
  Serve->>State: construct ApiContext<State<...>>
  loop additional queues
    Serve->>Reg: register_queue(..., State)\n(await)
  end
  Serve->>Reg: is_empty()\n(await)
  alt non-empty
    Serve->>Reg: task_queues_runner(token)\n(await)
    Reg-->>Serve: Runner
  end
  par start background services
    Serve->>BG: register_additional_background_services_fn(..., State)\n(await)
  and create router
    Serve->>Router: new_full_router({ state: State, ... })\n(await)
    Router->>SQ: api_config()\n(await)
  end
Loading
sequenceDiagram
  autonumber
  participant Client as Client
  participant API as Management API
  participant SQ as RegisteredTaskQueues

  Client->>API: SetTaskQueueConfig / ServerInfo
  API->>SQ: queue_names() / validate_config_fn(...)\n(await, sort_unstable/join)
  SQ-->>API: names / validator
  API-->>Client: response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Possibly related PRs

Poem

I hopped through locks and futures wide,
Awaited queues all side by side.
One ApiContext now holds the keys,
RwLocks hum softly in the breeze.
Hop, code, hop — async bliss, carrot-sized! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bebb228 and 36f4ebc.

📒 Files selected for processing (1)
  • crates/lakekeeper/src/serve.rs (9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/lakekeeper/src/serve.rs (4)
crates/lakekeeper/src/service/task_queue/mod.rs (5)
  • task (624-624)
  • task (636-636)
  • len (283-285)
  • new (179-184)
  • registered_task_queues (273-280)
crates/lakekeeper/src/api/router.rs (2)
  • new_full_router (79-158)
  • serve (226-239)
crates/lakekeeper/src/api/mod.rs (3)
  • shutdown_signal (27-75)
  • std (53-53)
  • std (56-56)
crates/lakekeeper-bin/src/serve.rs (4)
  • serve_inner (50-50)
  • serve_inner (54-54)
  • serve_inner (57-57)
  • serve_inner (62-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: clippy
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: test
  • GitHub Check: sqlx-check
  • GitHub Check: security_audit
🔇 Additional comments (13)
crates/lakekeeper/src/serve.rs (13)

39-45: Type alias looks good but lifetime parameter could be more specific.

The RegisterBackgroundServiceFn type alias correctly uses BoxFuture for async capabilities and includes the ApiContext<State<A, C, S>> parameter as intended. The lifetime parameter '_ is appropriate for the closure but could potentially be more explicit if needed for specific use cases.


103-103: Derive macro updated appropriately.

The addition of derive_more::Debug alongside typed_builder::TypedBuilder is appropriate given the custom debug implementations for the function vectors.


138-139: Custom debug implementations for function vectors are helpful.

The custom debug attribute showing the count of functions is much more useful than the default debug output which would be unreadable for function pointers.

Also applies to: 146-147


160-176: Proper initialization of background services infrastructure.

The setup of JoinSet, service tracking, and shutdown signal handler follows good practices for managing background services with proper cancellation support.


177-183: Channel setup for statistics and events is well-structured.

The channel setup with appropriate buffer sizes (1000) and proper type wrappers (EndpointStatisticsTrackerTx) provides good separation of concerns.


185-196: Delegation to serve_inner with comprehensive parameters.

The parameter passing to serve_inner is comprehensive and maintains good separation between the outer orchestration logic and the inner service setup.


198-268: Robust shutdown handling with timeout and progress reporting.

The shutdown logic is well-implemented with:

  • Proper cancellation token usage
  • Configurable timeout (20 seconds)
  • Progress reporting every 5 seconds
  • Graceful handling followed by forced abort
  • Comprehensive logging

353-363: Task queue registration updated to use async API.

The built-in task queue registration properly uses the async API with .await which aligns with the broader async conversion.


365-382: ApiContext construction and task queue registration is well-structured.

The code properly:

  • Creates the shared ApiContext<State<A, C, S>> with interior mutability
  • Includes all necessary components (authz, catalog, secrets, etc.)
  • Uses the async registration pattern for additional task queues
  • Maintains proper error propagation

384-398: Router construction updated to use unified state.

The router construction now properly uses the unified state parameter instead of individual components, which is consistent with the new architecture using ApiContext<State<A, C, S>>.


435-446: Additional background service registration follows async pattern.

The background service registration properly:

  • Uses async function calls with .await
  • Passes the shared state context
  • Maintains proper error handling
  • Includes logging for spawned services

448-461: Task queue runner setup uses async API properly.

The task queue runner setup correctly uses the async APIs (task_queues_runner().await and is_empty().await) which is consistent with the interior mutability design using Arc<RwLock>.


472-491: Service completion handling is robust.

The service completion handling properly:

  • Uses the updated log_service_completion function
  • Handles the shutdown signal case specifically
  • Maintains proper error context propagation
  • Handles the case where no services were started
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ct/register-tasks-interior-mutability

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@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: 0

🧹 Nitpick comments (7)
crates/lakekeeper/src/api/management/v1/bootstrap.rs (2)

206-214: Awaiting queue_names is correct; consider returning a stable, sorted list for deterministic API responses.

Right now, the queues vector’s order depends on the underlying map iteration order. Sorting once before collecting avoids nondeterminism across runs/nodes and simplifies testing.

Apply this diff to sort the queue names and keep the rest unchanged:

-            queues: state
-                .v1_state
-                .registered_task_queues
-                .queue_names()
-                .await
-                .into_iter()
-                .map(ToString::to_string)
-                .collect(),
+            queues: {
+                let mut names = state
+                    .v1_state
+                    .registered_task_queues
+                    .queue_names()
+                    .await;
+                names.sort_unstable();
+                names.into_iter().map(ToString::to_string).collect()
+            },

113-114: Minor consistency nit: clone usage for catalog handle differs between transactions.

Lines 113-114 call begin_write(state.v1_state.catalog.clone()) while lines 152-153 call begin_write(state.v1_state.catalog). If catalog is an Arc (likely), both are fine, but consistent style improves readability and signals intent. Consider picking one style across the file.

Also applies to: 152-153

crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (3)

979-989: Validation path aligns with async registry; consider avoiding JSON clone if feasible.

The shift to validate_config_fn(...).await is correct. If ValidatorFn is under your control, consider changing it to accept &serde_json::Value to avoid cloning potentially large configs:

  • Today: validate_config_fn(request.queue_config.0.clone())
  • Suggested (if feasible): validate_config_fn(&request.queue_config.0)

This is optional and only worth it if configs tend to be large.


990-999: Improve not-found error message: remove debug braces and present a readable, sorted list of queues.

The current message uses [{existing_queue_names:?}], which adds double brackets and debug formatting. Build a clean, comma-separated list instead.

Apply this diff:

-        } else {
-            let existing_queue_names = task_queues.queue_names().await;
-            return Err(ErrorModel::bad_request(
-                format!(
-                    "Queue '{queue_name}' not found! Existing queues: [{existing_queue_names:?}]"
-                ),
-                "QueueNotFound",
-                None,
-            )
-            .into());
-        }
+        } else {
+            let mut existing_names = task_queues
+                .queue_names()
+                .await
+                .into_iter()
+                .map(ToString::to_string)
+                .collect::<Vec<_>>();
+            existing_names.sort_unstable();
+            let existing_names = existing_names.join(", ");
+            return Err(
+                ErrorModel::bad_request(
+                    format!("Queue '{queue_name}' not found! Existing queues: [{existing_names}]"),
+                    "QueueNotFound",
+                    None,
+                )
+                .into(),
+            );
+        }

976-1001: Add unit/integration tests for queue config validation and not-found paths.

Given the new async accessors, tests that assert:

  • invalid config gets a 400 with InvalidQueueConfig, and
  • unknown queue returns QueueNotFound with the existing queue list,

would prevent regressions. I can scaffold these in the test module alongside other management tests.

crates/lakekeeper/src/tests/drop_warehouse.rs (1)

109-115: Minor naming nit: queues_future is a JoinHandle.

Variable name suggests a future, but after await it’s a JoinHandle<()>. Consider renaming to queues_handle for clarity (as done elsewhere).

crates/lakekeeper/src/service/task_queue/mod.rs (1)

297-319: Consider optimizing read lock acquisition.

The method currently acquires read locks separately for registered_queues and task_workers. Consider acquiring both locks once and building the result to minimize lock contention.

-pub async fn task_queues_runner(
-    &self,
-    cancellation_token: CancellationToken,
-) -> TaskQueuesRunner {
+pub async fn task_queues_runner(
+    &self,
+    cancellation_token: CancellationToken,
+) -> TaskQueuesRunner {
     let mut registered_task_queues = HashMap::new();
 
-    for name in self.registered_queues.read().await.keys() {
-        if let Some(worker) = self.task_workers.read().await.get(name) {
-            registered_task_queues.insert(
-                *name,
-                QueueWorkerConfig {
-                    worker_fn: Arc::clone(&worker.worker_fn),
-                    num_workers: worker.num_workers,
-                },
-            );
-        }
+    let queues = self.registered_queues.read().await;
+    let workers = self.task_workers.read().await;
+    
+    for name in queues.keys() {
+        if let Some(worker) = workers.get(name) {
+            registered_task_queues.insert(
+                *name,
+                QueueWorkerConfig {
+                    worker_fn: Arc::clone(&worker.worker_fn),
+                    num_workers: worker.num_workers,
+                },
+            );
+        }
     }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8fec31f and cabfa89.

📒 Files selected for processing (10)
  • crates/lakekeeper/src/api/management/v1/bootstrap.rs (1 hunks)
  • crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2 hunks)
  • crates/lakekeeper/src/api/router.rs (7 hunks)
  • crates/lakekeeper/src/catalog/views.rs (1 hunks)
  • crates/lakekeeper/src/serve.rs (6 hunks)
  • crates/lakekeeper/src/service/task_queue/mod.rs (13 hunks)
  • crates/lakekeeper/src/tests/drop_warehouse.rs (2 hunks)
  • crates/lakekeeper/src/tests/mod.rs (3 hunks)
  • crates/lakekeeper/src/tests/stats.rs (1 hunks)
  • crates/lakekeeper/src/tests/tasks.rs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (5)
  • validate_config_fn (82-88)
  • queue_name (62-62)
  • queue_name (760-762)
  • queue_name (1042-1044)
  • queue_name (1054-1056)
crates/lakekeeper/src/tests/stats.rs (1)
crates/lakekeeper/src/tests/mod.rs (1)
  • spawn_build_in_queues (301-320)
crates/lakekeeper/src/catalog/views.rs (1)
crates/lakekeeper/src/tests/mod.rs (1)
  • get_api_context (268-295)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
crates/lakekeeper/src/service/authz/mod.rs (1)
  • new (773-778)
crates/io/src/memory.rs (2)
  • len (93-95)
  • is_empty (98-100)
crates/lakekeeper/src/serve.rs (2)
crates/lakekeeper/src/api/mod.rs (1)
  • shutdown_signal (27-75)
crates/lakekeeper/src/service/task_queue/mod.rs (1)
  • registered_task_queues (276-283)
crates/lakekeeper/src/tests/drop_warehouse.rs (1)
crates/lakekeeper/src/tests/mod.rs (1)
  • get_api_context (268-295)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: test
  • GitHub Check: sqlx-check
🔇 Additional comments (21)
crates/lakekeeper/src/tests/stats.rs (1)

30-31: LGTM: awaiting the async queue spawner is correct.

spawn_build_in_queues is async and returns a JoinHandle<()>; awaiting it here to obtain the handle is the right fix. The later cancellation_token.cancel(); queues_handle.await.unwrap(); cleanly shuts down workers.

crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (1)

1-1042: All async queue registry methods are properly awaited

I’ve inspected all call sites of both queue_names() and validate_config_fn(...). In bootstrap.rs, the call to .queue_names() is immediately followed by .await on the next line. In service/task_queue/mod.rs, every invocation of .validate_config_fn(...) in the tests is likewise awaited. There are no missing .await usages.

No changes are needed.

crates/lakekeeper/src/tests/drop_warehouse.rs (1)

31-31: LGTM: awaiting async get_api_context.

The helper is now async; awaiting it here is correct and keeps the setup consistent with the rest of the suite.

crates/lakekeeper/src/catalog/views.rs (1)

167-169: LGTM: awaiting async get_api_context in test setup.

This aligns with the updated async initialization flow and keeps the helper consistent across tests.

crates/lakekeeper/src/tests/mod.rs (3)

206-206: LGTM!

The transformation of get_api_context to an async function is correctly implemented.


268-295: LGTM! Interior mutability pattern correctly implemented.

The new async get_api_context function properly creates the ApiContext with the updated RegisteredTaskQueues that uses interior mutability. The registration of built-in queues is appropriately awaited.


301-320: LGTM! Task runner creation properly async.

The spawn_build_in_queues function correctly handles the async task queue registration and runner creation patterns. The function properly awaits both register_built_in_queues and task_queues_runner calls.

crates/lakekeeper/src/tests/tasks.rs (2)

64-94: LGTM! Task queue registration properly migrated to async.

The test correctly awaits the register_queue call, aligning with the new async API.


141-146: LGTM! Task runner creation properly awaited.

The test correctly awaits the task_queues_runner call before spawning the worker task.

crates/lakekeeper/src/api/router.rs (3)

45-52: LGTM! Router arguments simplified with ApiContext.

The RouterArgs struct has been successfully refactored to use a single ApiContext<State<A, C, S>> instead of multiple separate state components, reducing complexity and improving encapsulation.


80-94: LGTM! Router construction properly async.

The new_full_router function signature is correctly updated to be async and properly destructures the new RouterArgs format.


129-130: No error handling needed for api_config()
The registered_task_queues.api_config().await call returns a plain Vec<QueueApiConfig> (not a Result), so there is no error path to handle. You can safely omit any additional error‐handling logic here.

Likely an incorrect or invalid review comment.

crates/lakekeeper/src/service/task_queue/mod.rs (4)

72-74: LGTM! Interior mutability pattern for shared state.

The change from Arc<HashMap<...>> to Arc<RwLock<HashMap<...>>> enables proper shared mutable state between RegisteredTaskQueues instances, allowing tasks registered later to be visible to previously created instances.


276-283: Excellent documentation of shared state semantics.

The comment clearly explains the importance of sharing the interior mutable state to ensure that later registrations are reflected in previously created instances. This is critical for the correct functioning of the system.


186-221: LGTM! Queue registration properly uses async write locks.

The async register_queue method correctly uses write locks when inserting into both registered_queues and task_workers. The pattern ensures thread safety while allowing concurrent reads.


1031-1162: Excellent test coverage for shared interior mutable state!

The test_shared_interior_mutable_state test thoroughly validates that multiple RegisteredTaskQueues instances share the same interior mutable state, ensuring that later registrations are visible to previously created instances. This is critical for the correct functioning of the system.

crates/lakekeeper/src/serve.rs (5)

39-46: LGTM! Well-designed type aliases for extensibility.

The new type aliases RegisterBackgroundServiceFn and RegisterTaskQueueFn provide a clean interface for registering additional services and task queues with access to the ApiContext.


214-222: LGTM! Built-in queue registration properly async.

The built-in queue registration correctly awaits the async register_built_in_queues call.


224-241: Excellent architectural design with interior mutability!

The code properly leverages interior mutability to allow later task queue registrations to affect the state of previously registered queues. The comment clearly explains this important behavior. The ApiContext is correctly constructed and passed to additional task queue registration functions.


322-325: LGTM! Task runner creation properly awaited.

The task runner is correctly created using the async task_queues_runner method, and the emptiness check properly uses the async is_empty() method.


310-314: LGTM! Background services receive proper context.

The additional background service registration functions now correctly receive the ApiContext state, enabling them to access all necessary components of the system.

@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: 0

Caution

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

⚠️ Outside diff range comments (1)
crates/lakekeeper/src/tests/mod.rs (1)

268-295: Share a single TaskQueueRegistry between ApiContext and worker runner (current split breaks interior mutability contract)

Right now get_api_context creates a fresh TaskQueueRegistry, registers built-ins, extracts registered_task_queues into the state, then drops the registry. Later, spawn_build_in_queues constructs a different TaskQueueRegistry and registers built-ins again before starting the runner. This means the RegisteredTaskQueues inside ApiContext points to one Arc<RwLock<...>>, while the running workers observe another. That defeats the intended “interior mutability” model (see service/task_queue/mod.rs comment on sharing the same Arc).

Consequence: any later registrations (e.g., externally registered queues) won’t become visible to the state created earlier, and the runner may watch a different registry than the rest of the system.

Unify both to use the same registry instance. One minimal approach is to return the registry from get_api_context and pass it into spawn_build_in_queues.

Apply the following focused changes in this file:

- pub(crate) async fn get_api_context<T: Authorizer>(
+ pub(crate) async fn get_api_context<T: Authorizer>(
     pool: &PgPool,
     auth: T,
-) -> ApiContext<State<T, PostgresCatalog, SecretsState>> {
+) -> (ApiContext<State<T, PostgresCatalog, SecretsState>>, TaskQueueRegistry) {
@@
-    let mut task_queues = TaskQueueRegistry::new();
+    let mut task_queues = TaskQueueRegistry::new();
@@
-    let registered_task_queues = task_queues.registered_task_queues();
-    ApiContext {
+    let registered_task_queues = task_queues.registered_task_queues();
+    let ctx = ApiContext {
         v1_state: State {
             authz: auth,
-            catalog: CatalogState::from_pools(pool.clone(), pool.clone()),
-            secrets: SecretsState::from_pools(pool.clone(), pool.clone()),
+            catalog: catalog_state.clone(),
+            secrets: secret_store.clone(),
             contract_verifiers: ContractVerifiers::new(vec![]),
             hooks: EndpointHookCollection::new(vec![]),
             registered_task_queues,
         },
-    }
+    };
+    (ctx, task_queues)
 }
-    let api_context = get_api_context(&pool, authorizer).await;
+    let (api_context, mut task_queue_registry) = get_api_context(&pool, authorizer).await;
-pub(crate) async fn spawn_build_in_queues<T: Authorizer>(
-    ctx: &ApiContext<State<T, PostgresCatalog, SecretsState>>,
-    poll_interval: Option<std::time::Duration>,
-    cancellation_token: crate::CancellationToken,
-) -> tokio::task::JoinHandle<()> {
-    let ctx = ctx.clone();
-
-    let mut task_queues = TaskQueueRegistry::new();
-    task_queues
-        .register_built_in_queues::<PostgresCatalog, _, _>(
-            ctx.v1_state.catalog.clone(),
-            ctx.v1_state.secrets.clone(),
-            ctx.v1_state.authz.clone(),
-            poll_interval.unwrap_or(CONFIG.task_poll_interval),
-        )
-        .await;
-    let task_runner = task_queues.task_queues_runner(cancellation_token).await;
+pub(crate) async fn spawn_build_in_queues<T: Authorizer>(
+    _ctx: &ApiContext<State<T, PostgresCatalog, SecretsState>>,
+    task_queue_registry: &mut TaskQueueRegistry,
+    _poll_interval: Option<std::time::Duration>,
+    cancellation_token: crate::CancellationToken,
+) -> tokio::task::JoinHandle<()> {
+    // Built-in queues already registered in get_api_context on the same registry.
+    let task_runner = task_queue_registry.task_queues_runner(cancellation_token).await;
     tokio::task::spawn(task_runner.run_queue_workers(true))
 }

Note: You’ll need to update any call sites of get_api_context and spawn_build_in_queues in tests to pass the shared registry through. This mirrors the correct pattern you implemented in serve.rs where the same registry is used for both state and runner.

Also applies to: 301-320

🧹 Nitpick comments (7)
crates/lakekeeper/src/tests/mod.rs (3)

272-295: Avoid re-creating catalog/secrets states; reuse the earlier ones

You compute catalog_state and secret_store up-front but then re-create them when building ApiContext. Reuse the originals to avoid duplication.

-            catalog: CatalogState::from_pools(pool.clone(), pool.clone()),
-            secrets: SecretsState::from_pools(pool.clone(), pool.clone()),
+            catalog: catalog_state.clone(),
+            secrets: secret_store.clone(),

306-308: Remove unused clone

let ctx = ctx.clone(); is unused in the current body.

-    let ctx = ctx.clone();
+    // no-op

301-301: Naming nit: “built_in” vs “build_in”

Consider renaming spawn_build_in_queues to spawn_built_in_queues for clarity and consistency.

crates/lakekeeper/src/serve.rs (4)

38-46: Consider allowing closures with captures for registration hooks (not just fn pointers)

Using fn aliases forces zero-capture functions. If you expect external registrars to reference config or environment, prefer trait objects so callers can pass closures that capture state.

Example shape:

-pub type RegisterBackgroundServiceFn<A, C, S> = fn(
-    &mut JoinSet<Result<(), anyhow::Error>>,
-    CancellationToken,
-    ApiContext<State<A, C, S>>,
-) -> Vec<(String, AbortHandle)>;
+pub type RegisterBackgroundServiceFn<A, C, S> =
+    std::sync::Arc<
+        dyn Fn(
+            &mut JoinSet<Result<(), anyhow::Error>>,
+            CancellationToken,
+            ApiContext<State<A, C, S>>,
+        ) -> Vec<(String, AbortHandle)>
+        + Send
+        + Sync
+        + 'static,
+    >;
 
-pub type RegisterTaskQueueFn<A, C, S> =
-    fn(&mut TaskQueueRegistry, ApiContext<State<A, C, S>>) -> anyhow::Result<()>;
+pub type RegisterTaskQueueFn<A, C, S> =
+    std::sync::Arc<
+        dyn Fn(&mut TaskQueueRegistry, ApiContext<State<A, C, S>>) -> anyhow::Result<()>
+            + Send
+            + Sync
+            + 'static,
+    >;

You’d also change the ServeConfiguration fields to Vec<Arc<...>>. Call sites then pass Arc::new(|...| { ... }). If you intentionally want only zero-capture FNs for a stable plugin ABI, ignore this.


213-221: Built-in task queue registration now async: add operational visibility

You’re awaiting registration silently. Consider logging duration and effective poll interval for troubleshooting.

-    if enable_built_in_queues {
-        task_queue_registry
+    if enable_built_in_queues {
+        let started = std::time::Instant::now();
+        task_queue_registry
             .register_built_in_queues::<C, _, _>(
                 catalog_state.clone(),
                 secrets_state.clone(),
                 authorizer.clone(),
                 CONFIG.task_poll_interval,
             )
             .await;
+        tracing::info!(
+            "Registered built-in task queues in {:?} (poll_interval = {:?})",
+            started.elapsed(),
+            CONFIG.task_poll_interval
+        );
     }

238-240: Propagate context on registration errors

When a custom registration fails, add context to aid debugging which hook failed.

-    for register_fn in register_additional_task_queues_fn {
-        register_fn(&mut task_queue_registry, state.clone())?;
-    }
+    for (idx, register_fn) in register_additional_task_queues_fn.into_iter().enumerate() {
+        register_fn(&mut task_queue_registry, state.clone())
+            .map_err(|e| anyhow::anyhow!(e).context(format!("additional task queue registrar index {idx} failed")))?;
+    }

321-324: Nice: avoid spinning worker monitor when no queues are registered; consider logging counts/names

The emptiness check prevents unnecessary tasks. If available, log the number and names of registered queues for observability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cabfa89 and 5ba1537.

📒 Files selected for processing (10)
  • crates/lakekeeper/src/api/management/v1/bootstrap.rs (1 hunks)
  • crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2 hunks)
  • crates/lakekeeper/src/api/router.rs (7 hunks)
  • crates/lakekeeper/src/catalog/views.rs (1 hunks)
  • crates/lakekeeper/src/serve.rs (6 hunks)
  • crates/lakekeeper/src/service/task_queue/mod.rs (16 hunks)
  • crates/lakekeeper/src/tests/drop_warehouse.rs (3 hunks)
  • crates/lakekeeper/src/tests/mod.rs (3 hunks)
  • crates/lakekeeper/src/tests/stats.rs (1 hunks)
  • crates/lakekeeper/src/tests/tasks.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/lakekeeper/src/tests/stats.rs
  • crates/lakekeeper/src/api/management/v1/bootstrap.rs
  • crates/lakekeeper/src/tests/tasks.rs
🧰 Additional context used
🧬 Code graph analysis (6)
crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2)
crates/lakekeeper/src/service/task_queue/mod.rs (5)
  • validate_config_fn (82-88)
  • queue_name (62-62)
  • queue_name (763-765)
  • queue_name (1045-1047)
  • queue_name (1057-1059)
crates/iceberg-ext/src/catalog/rest/error.rs (1)
  • bad_request (127-133)
crates/lakekeeper/src/tests/drop_warehouse.rs (1)
crates/lakekeeper/src/tests/mod.rs (2)
  • get_api_context (268-295)
  • spawn_build_in_queues (301-320)
crates/lakekeeper/src/catalog/views.rs (1)
crates/lakekeeper/src/tests/mod.rs (1)
  • get_api_context (268-295)
crates/lakekeeper/src/tests/mod.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (3)
  • new (179-184)
  • task (627-627)
  • task (639-639)
crates/lakekeeper/src/serve.rs (3)
crates/lakekeeper/src/api/mod.rs (1)
  • shutdown_signal (27-75)
crates/lakekeeper/src/service/task_queue/mod.rs (1)
  • registered_task_queues (276-283)
crates/lakekeeper/src/api/iceberg/v1/tables.rs (1)
  • router (139-342)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
crates/lakekeeper/src/service/authz/mod.rs (1)
  • new (960-965)
crates/io/src/memory.rs (3)
  • new (36-38)
  • len (93-95)
  • is_empty (98-100)
🔇 Additional comments (36)
crates/lakekeeper/src/api/router.rs (6)

44-51: LGTM - Router consolidation improves maintainability.

The consolidation of multiple fields into a single state: ApiContext<State<A, C, S>> field simplifies the API surface and centralizes state management.


79-94: Function signature properly async-ified.

The async modification is necessary for the new .api_config().await call on line 128. The destructuring pattern correctly extracts state from the unified RouterArgs.


97-98: Authorizer access correctly derived from state.

The change from separate authorizer parameter to state.v1_state.authz.clone() aligns with the unified state approach.


105-105: Consistent authorizer usage.

Authorization middleware now correctly uses the same authorizer instance from the unified state.


128-129: Async task queue config retrieval properly implemented.

The awaited call to api_config() and subsequent collection into a vector correctly handles the async nature of the new API.


151-151: State properly passed to router.

Using .with_state(state) with the unified ApiContext maintains consistency with the new architecture.

crates/lakekeeper/src/service/task_queue/mod.rs (17)

15-16: Interior mutability primitives correctly imported.

The imports of RwLock and CancellationToken from tokio align with the interior mutability changes throughout the module.


45-47: TaskQueueWorker signature updated for new cancellation token.

The change from crate::CancellationToken to tokio_util::sync::CancellationToken maintains consistency with the async task infrastructure.


73-73: Interior mutability correctly implemented.

Using Arc<RwLock<HashMap<...>>> enables shared mutable state across RegisteredTaskQueues instances, which is essential for dynamic queue registration.


82-88: Async validation function properly implemented.

The async nature allows for proper lock acquisition without blocking the caller.


92-99: Async API config retrieval correctly implemented.

The read lock acquisition and collection properly handles concurrent access to the shared state.


103-105: Async queue names retrieval implemented correctly.

The implementation follows the same pattern as other async methods in this struct.


146-149: Registry interior mutability correctly implemented.

Both registered queues and task workers use the same Arc<RwLock<HashMap<...>>> pattern for consistency.


181-183: Initialization properly creates interior mutable state.

Using Arc::new(RwLock::new(HashMap::new())) correctly initializes the shared mutable collections.


186-221: Queue registration properly async and thread-safe.

The async registration method correctly acquires write locks to modify the shared state, ensuring thread safety.


223-272: Built-in queue registration correctly updated.

The method properly awaits the individual queue registrations and maintains the same functionality while supporting async operations.


276-283: Shared interior mutable state correctly implemented.

The comment clearly explains the rationale for sharing interior mutable state, and the implementation properly clones the Arc references.


286-293: Async length and empty checks properly implemented.

The async methods correctly acquire read locks to check collection state.


297-322: Task queue runner creation correctly handles async state.

The method properly acquires read locks on both collections and builds the runner configuration while maintaining thread safety.


557-559: SpecializedTask fields properly made private.

Making config and data fields private maintains encapsulation while supporting the internal usage patterns.


670-670: Poll function signature updated for new cancellation token.

The change from crate::CancellationToken to tokio_util::sync::CancellationToken maintains consistency with the task worker interface.


1008-1166: Comprehensive test for shared interior mutable state.

The test thoroughly verifies that multiple RegisteredTaskQueues instances share the same interior mutable state, which is crucial for the dynamic registration feature.


1179-1189: Test properly updated for async queue registration.

The test correctly awaits the async register_built_in_queues method and uses the new cancellation token type.

crates/lakekeeper/src/api/management/v1/warehouse/mod.rs (2)

979-979: Async validation function lookup properly implemented.

The await on validate_config_fn(&queue_name).await correctly handles the async nature of the queue registry.


990-996: Enhanced error message with sorted queue names.

The async retrieval of queue names, followed by sorting and joining, provides a better user experience by listing available queues in a consistent order.

crates/lakekeeper/src/tests/drop_warehouse.rs (3)

31-31: Test properly awaits async API context creation.

The change to get_api_context(&pool, authorizer).await correctly handles the new async signature of the helper function.


109-115: Task queue spawning correctly updated for async pattern.

The awaited call to spawn_build_in_queues and assignment to queues_handle properly handles the async queue setup.


135-135: Test cleanup properly awaits task completion.

Using queues_handle.await.unwrap() correctly waits for task completion before test teardown.

crates/lakekeeper/src/catalog/views.rs (1)

167-167: Test helper correctly updated for async API context.

The change to crate::tests::get_api_context(&pool, AllowAllAuthorizer).await properly handles the new async signature while maintaining the same return type.

crates/lakekeeper/src/tests/mod.rs (2)

206-206: Good async migration: awaiting get_api_context is correct

Call site updated to .await; aligns with the new async signature.


275-284: register_built_in_queues is infallible

After inspecting the signature in crates/lakekeeper/src/service/task_queue/mod.rs (lines 223–231), register_built_in_queues returns &mut Self, not a Result. There is no error to propagate or handle, so the existing .await usage in crates/lakekeeper/src/tests/mod.rs is correct — no ? or explicit error handling is needed.

Likely an incorrect or invalid review comment.

crates/lakekeeper/src/serve.rs (5)

10-10: Import changes look correct

Bringing ApiContext and shutdown_signal into scope matches the updated router and shutdown flow.


122-130: ServeConfiguration API evolution looks coherent

Switching to vectors of registration hooks with generics over A, C, S gives strong typing and makes extension points explicit.


223-237: Correct: state now holds the same RegisteredTaskQueues Arc as the registry

This matches the interior mutability contract (later registrations are visible to earlier holders). Please ensure the tests helper mirrors this pattern; currently it creates a separate registry for the runner.

Would you like me to open a follow-up to align crates/lakekeeper/src/tests/mod.rs with this pattern?


245-252: Router construction with unified ApiContext is on-point

Passing state through RouterArgs keeps handler signatures consistent across services. Async new_full_router(...).await? is appropriate.


309-314: Background service hooks now receive ApiContext: good extensibility

This enables services to access auth/catalog/secrets consistently. No issues spotted.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 26, 2025

@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: 1

🧹 Nitpick comments (4)
crates/lakekeeper/src/serve.rs (3)

38-46: Consider adding 'static bound to background service registrars (or confirm it’s unnecessary).

These closures are stored in a Vec inside ServeConfiguration and used across the server lifetime. Adding + 'static to the trait object can prevent accidental captures of non-'static references.

Example:

-pub type RegisterBackgroundServiceFn<A, C, S> = std::sync::Arc<
-    dyn Fn(
+pub type RegisterBackgroundServiceFn<A, C, S> = std::sync::Arc<
+    dyn Fn(
             &mut JoinSet<Result<(), anyhow::Error>>,
             CancellationToken,
             ApiContext<State<A, C, S>>,
         ) -> Vec<(String, AbortHandle)>
-        + Send
-        + Sync,
+        + Send
+        + Sync
+        + 'static,
 >;

If you intentionally allow non-'static captures (e.g., in tests), feel free to ignore.


48-50: Evaluate whether task-queue registrars should be async-friendly.

RegisterTaskQueueFn is synchronous. If external registrars need to perform async I/O (e.g., dynamic discovery, migrations), the current signature forces workarounds. Consider returning a future (e.g., Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send>>) or using async_trait.

If you decide to support async:

-use std::sync::Arc;
+use std::{pin::Pin, sync::Arc};
+use futures::Future;

-pub type RegisterTaskQueueFn<A, C, S> = std::sync::Arc<
-    dyn Fn(&mut TaskQueueRegistry, ApiContext<State<A, C, S>>) -> anyhow::Result<()> + Send + Sync,
->;
+pub type RegisterTaskQueueFn<A, C, S> = Arc<
+  dyn Fn(
+    &mut TaskQueueRegistry,
+    ApiContext<State<A, C, S>>,
+  ) -> Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send>>
+  + Send
+  + Sync
+  + 'static
+>;

Then for register_fn in … { register_fn(&mut registry, state.clone()).await?; }.


328-331: Create the task runner only when queues exist.

Minor efficiency tweak: avoid building the runner if the registry is empty.

Apply this diff:

-    let task_runner = task_queue_registry
-        .task_queues_runner(cancellation_token.clone())
-        .await;
-    if task_queue_registry.is_empty().await {
+    if task_queue_registry.is_empty().await {
         tracing::info!("No task queues registered, skipping task queue worker startup");
     } else {
+        let task_runner = task_queue_registry
+            .task_queues_runner(cancellation_token.clone())
+            .await;
         let task_abort_handle = service_futures.spawn(async move {
             task_runner.run_queue_workers(true).await;
             Ok(())
         });
         service_ids.insert(task_abort_handle.id(), "Task Worker Monitor".to_string());
     }
crates/lakekeeper/src/tests/mod.rs (1)

301-318: Avoid re-registering built-in queues in spawn_build_in_queues; prefer sharing the registry used to create ApiContext.

You’re creating a new TaskQueueRegistry and re-registering built-ins here, which diverges from the registered_task_queues embedded in ctx.v1_state. This undermines the “interior mutability shared across prior references” guarantee documented in registered_task_queues() and can surprise tests that expect late registrations to be visible to the runner.

Options:

  • Minimal: return the TaskQueueRegistry (or a runner) from get_api_context and use it here instead of constructing a new one.
  • API improvement: add TaskQueueRegistry::from_registered(RegisteredTaskQueues) or a TaskQueuesRunner::new(RegisteredTaskQueues, CancellationToken, poll_interval) constructor so workers and state share the same underlying Arc<RwLock<_>>.

If you keep this approach, please document that test workers operate on a separate registry instance.

Also, consider renaming the function to fix the typo:

-pub(crate) async fn spawn_build_in_queues<T: Authorizer>(
+pub(crate) async fn spawn_built_in_queues<T: Authorizer>(
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5ba1537 and 125830f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml (1 hunks)
  • crates/lakekeeper/src/serve.rs (7 hunks)
  • crates/lakekeeper/src/tests/mod.rs (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
crates/lakekeeper/src/serve.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
  • len (286-288)
  • registered_task_queues (276-283)
crates/lakekeeper/src/tests/mod.rs (1)
crates/lakekeeper/src/service/task_queue/mod.rs (4)
  • new (179-184)
  • registered_task_queues (276-283)
  • task (627-627)
  • task (639-639)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: sqlx-check
  • GitHub Check: docker / docker
🔇 Additional comments (6)
crates/lakekeeper/src/serve.rs (4)

220-228: LGTM: built-in task queues are registered before wiring state.

Awaiting register_built_in_queues here ensures the registered_task_queues snapshot reflects built-ins before external registrars run. Good ordering.


230-244: ApiContext<State<…>> consolidation is clean.

Moving authorizer, catalog, secrets, contract verifiers, hooks, and registered queues into a single ApiContext<State<…>> simplifies downstream wiring and keeps interior mutability semantics intact.


245-247: Confirm synchronous registrars are sufficient; otherwise, adopt async as noted.

Calling register_fn(&mut task_queue_registry, state.clone())?; is fine for pure registrations. If registrars need .await internally, the current sync signature will be limiting.

Would you like a follow-up patch to switch RegisterTaskQueueFn to an async-returning closure and update call sites?


92-92: Fix derive_more Debug formatting: current #[debug("…")] syntax likely won’t compile; use skip or correct fmt.

The per-field #[debug("…")] attributes on non-Debug fields are suspicious for derive_more::Debug and can cause a compile error by still requiring Debug on the field type if the attribute isn’t parsed. Minimal, robust fix: skip these fields in Debug to avoid trait bounds on Vec<Arc<dyn Fn…>>.

Apply this diff:

 #[derive(derive_more::Debug, typed_builder::TypedBuilder)]
 pub struct ServeConfiguration<
@@
     /// Additional task queues to run. Tuples of type:
     #[builder(default)]
-    #[debug("Vec with {} functions", register_additional_task_queues_fn.len())]
+    #[debug(skip)]
     pub register_additional_task_queues_fn: Vec<RegisterTaskQueueFn<A, C, S>>,
@@
     /// Additional background services / futures to await.
     #[builder(default)]
-    #[debug("Vec with {} functions", register_additional_background_services_fn.len())]
+    #[debug(skip)]
     pub register_additional_background_services_fn: Vec<RegisterBackgroundServiceFn<A, C, S>>,

If you do want a count in Debug output, consider manually implementing std::fmt::Debug for ServeConfiguration<…> or switch to the derivative crate (#[derivative(Debug)] with #[derivative(Debug="ignore")] on these fields).

Also applies to: 127-129, 135-137

⛔ Skipped due to learnings
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1298
File: crates/lakekeeper/src/service/secrets.rs:11-11
Timestamp: 2025-08-22T05:44:22.632Z
Learning: In crates/lakekeeper/src/implementations/kv2.rs, the SecretsState struct has a manual `impl std::fmt::Debug` implementation (lines 239-249) that properly redacts sensitive fields like vault_password (shows "REDACTED") and replaces complex objects like vault_client with simple string representations. This is the correct approach for Debug implementations on secret-handling types.
Learnt from: c-thiel
PR: lakekeeper/lakekeeper#1298
File: crates/lakekeeper/src/service/secrets.rs:11-11
Timestamp: 2025-08-22T05:44:22.632Z
Learning: In crates/lakekeeper/src/implementations/kv2.rs, there is a separate `impl std::fmt::Debug for SecretsState` implementation that provides Debug support for the KV2 SecretsState type, so it already satisfies Debug trait bounds without needing a derive macro.
crates/lakekeeper/src/tests/mod.rs (2)

206-206: LGTM: setup now awaits get_api_context.

This aligns tests with the new async initialization path.


268-295: get_api_context: solid stateful initialization; built-ins are registered before ApiContext is built.

The ordering guarantees registered_task_queues in State is consistent with built-ins.

Comment thread Cargo.toml Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 26, 2025

@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: 1

Caution

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

⚠️ Outside diff range comments (1)
crates/lakekeeper/src/service/task_queue/mod.rs (1)

223-230: Refactor async registration methods: remove &mut Self returns and add Clone bounds

The following async fn register_* methods in crates/lakekeeper/src/service/task_queue/mod.rs need two coordinated changes:

  1. Signature adjustment
    Returning &mut Self from an async fn is not supported (you cannot yield a mutable reference to self across an .await). Change each method to take &self (or consume self) and drop the -> &mut Self return.

  2. Add explicit Clone bounds
    Inside these methods, you clone both secret_store and authorizer. Constrain the generics accordingly:

    where
        S: SecretStore + Clone,
        A: Authorizer + Clone,

    — both AllowAllAuthorizer and the two SecretsState types already derive Clone (via #[derive(Clone)]), so this is a no-op for consumers.

Affected methods and approximate line ranges:

  • register_queue (around lines 200–206)
  • register_built_in_queues (223–230)
  • The other built-in registration methods (231–251, 252–270, 271–273)

Example update for register_built_in_queues:

-pub async fn register_built_in_queues<C: Catalog, S: SecretStore, A: Authorizer>(
-    &mut self,
+pub async fn register_built_in_queues<C, S, A>(
+    &self,
 where
+    C: Catalog,
+    S: SecretStore + Clone,
+    A: Authorizer + Clone,
 ) {
     let catalog_state_clone = catalog_state.clone();
@@
-    self
-}
+    // (no return)
+}

— Apply the same pattern to all register_* methods in this module.

🧹 Nitpick comments (5)
crates/lakekeeper/src/service/task_queue/mod.rs (5)

15-16: Import changes look good; minor consistency nit

RwLock and CancellationToken imports are correct for the new async/interior-mutability model. Minor style nit: elsewhere you sometimes use the fully-qualified tokio_util::sync::CancellationToken. Prefer the imported alias uniformly for readability.

Apply in-place where applicable (see Lines 45-47 and 671).

-use tokio_util::sync::CancellationToken;
+use tokio_util::sync::CancellationToken;
# Keep this import and use `CancellationToken` everywhere instead of the full path.

45-47: Use the imported CancellationToken alias for consistency

You import CancellationToken already, but the type alias uses the fully-qualified path. Use the alias to keep types concise and consistent.

-pub type TaskQueueWorker = Arc<
-    dyn Fn(tokio_util::sync::CancellationToken) -> BoxFuture<'static, ()> + Send + Sync + 'static,
->;
+pub type TaskQueueWorker = Arc<
+    dyn Fn(CancellationToken) -> BoxFuture<'static, ()> + Send + Sync + 'static,
+>;

297-322: Build runner state without holding both read locks longer than necessary

This is okay as-is, but you can minimize lock hold time by scoping guards or collecting names first. Not critical given small maps at bootstrap.

Example (pseudo-diff):

- let queues = self.registered_queues.read().await;
- let workers = self.task_workers.read().await;
- for name in queues.keys() {
+ let queue_names: Vec<_> = {
+     let queues = self.registered_queues.read().await;
+     queues.keys().copied().collect()
+ };
+ let workers = self.task_workers.read().await;
+ for name in queue_names {

Also applies to: 303-316


667-671: Use imported CancellationToken here too

Be consistent with the alias you import at the top.

-        cancellation_token: tokio_util::sync::CancellationToken,
+        cancellation_token: CancellationToken,

333-366: Optional: Consider JoinSet to simplify worker supervision

Current select_all over a mutable slice of JoinHandles works, but JoinSet from Tokio simplifies spawn/wait/restart logic and avoids rebuilding handle slices each loop.

Sketch (outside current hunk):

let mut set = tokio::task::JoinSet::new();
for (queue_name, queue) in registered_queues.iter() {
    for worker_id in 0..queue.num_workers {
        let token = self.cancellation_token.clone();
        let name = *queue_name;
        set.spawn(async move {
            (queue.worker_fn)(token).await;
            (name, worker_id)
        });
    }
}

while let Some(res) = set.join_next().await {
    match res {
        Ok((name, id)) => { /* log; maybe restart */ }
        Err(e) => { /* log panic; maybe restart */ }
    }
    // if restart: set.spawn(...);
}

Also applies to: 368-431

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 125830f and 11892b7.

📒 Files selected for processing (2)
  • crates/lakekeeper/src/service/task_queue/mod.rs (15 hunks)
  • crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • crates/lakekeeper/src/service/task_queue/tabular_purge_queue.rs
🧰 Additional context used
🧬 Code graph analysis (1)
crates/lakekeeper/src/service/task_queue/mod.rs (2)
crates/lakekeeper/src/service/authz/mod.rs (1)
  • new (960-965)
crates/io/src/memory.rs (2)
  • len (93-95)
  • is_empty (98-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: test
  • GitHub Check: sqlx-check
  • GitHub Check: clippy
🔇 Additional comments (6)
crates/lakekeeper/src/service/task_queue/mod.rs (6)

73-74: Interior mutability for RegisteredTaskQueues is sound

The Arc<RwLock<HashMap<…>>> approach correctly enables sharing across states, and the async getters use read().await appropriately. The API surface is minimal and clear. No issues here.

Also applies to: 82-88, 92-99, 103-105


146-149: Registry state sharing LGTM

Switching TaskQueueRegistry maps to Arc<RwLock<…>> and initializing them in new() is correct and aligns with the shared-state objective.

Also applies to: 181-183


274-283: Good: registered_task_queues shares interior-mutable state

The comment explains the intention, and cloning the Arc<RwLock<…>> ensures older state handles see new registrations. Nice.


286-293: len/is_empty async accessors match the new pattern

Mirrors the io::memory style; clear and efficient.


1008-1014: Great test validating shared interior mutability

The test thoroughly proves that previously created RegisteredTaskQueues observe later registrations. Nicely done.

Also applies to: 1033-1165


1167-1189: Built-in queues test wiring aligns with new async APIs

Calling register_built_in_queues().await and creating a runner with a CancellationToken works as intended.

Comment on lines 186 to 191
pub async fn register_queue<T: QueueConfig>(
&mut self,
task_queue: QueueRegistration,
) -> &mut Self {
let QueueRegistration {
queue_name,

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.

💡 Verification agent

🧩 Analysis chain

async fn returning &mut Self will not compile; switch to &self and return () (or a Result)

Rust async fns cannot safely return references tied to self (like &mut Self) when they .await inside; the future would have to hold a borrow across an await point. This pattern typically fails to compile. Also, with interior mutability, &mut self is no longer required.

Suggested minimal change (return unit, take &self):

-pub async fn register_queue<T: QueueConfig>(
-    &mut self,
-    task_queue: QueueRegistration,
-) -> &mut Self {
+pub async fn register_queue<T: QueueConfig>(
+    &self,
+    task_queue: QueueRegistration,
+) {
@@
-        self
+        // no return

Optionally, return a boolean indicating whether an entry was replaced:

-pub async fn register_queue<T: QueueConfig>(&self, task_queue: QueueRegistration) {
+pub async fn register_queue<T: QueueConfig>(&self, task_queue: QueueRegistration) -> bool {
@@
-    self.registered_queues.write().await.insert(
+    let prev = self.registered_queues.write().await.insert(
@@
-    self.task_workers.write().await.insert(
+    self.task_workers.write().await.insert(
@@
-    // no return
+    prev.is_some()

Run to find potential chaining that relied on the old &mut Self return:

Also applies to: 205-221


🏁 Script executed:

#!/bin/bash
# Identify any chaining after `register_queue(...).await`
rg -nP --type=rust -C2 '\.register_queue::<[^>]+>\([^)]*\)\.await\.\w'

Length of output: 72


🏁 Script executed:

#!/bin/bash
# Inspect the implementation of register_queue
sed -n '170,240p' crates/lakekeeper/src/service/task_queue/mod.rs

# Find all call sites of register_queue to check for method chaining
rg -nP --type=rust '\.register_queue\(' -C3 crates/lakekeeper/src

Length of output: 2520


🏁 Script executed:

#!/bin/bash
# Print the full implementation of register_built_in_queues for context
sed -n '180,300p' crates/lakekeeper/src/service/task_queue/mod.rs

# Find all occurrences of register_queue calls anywhere in the repo
rg -n '\.register_queue' -C2 crates/lakekeeper/src

Length of output: 6618


🏁 Script executed:

#!/bin/bash
# Display the test file to verify how `register_queue` is being used in tests
sed -n '1,200p' crates/lakekeeper/src/tests/tasks.rs

Length of output: 6274


Fix async fn signatures to avoid returning &mut Self

The register_queue and register_built_in_queues functions currently have signatures that return &mut Self, which will fail to compile because async functions cannot yield references to self across await points. These methods only use interior mutability (via Arc<RwLock<…>>), so they should take &self and return () (or another non‐borrowing type). No call sites depend on the returned &mut Self, so this change is safe.

Changes needed:

  • crates/lakekeeper/src/service/task_queue/mod.rs, lines ~186–191
    • Change

    pub async fn register_queue<T: QueueConfig>(
        &mut self,
        task_queue: QueueRegistration,
    ) -> &mut Self {

    to

    pub async fn register_queue<T: QueueConfig>(
        &self,
        task_queue: QueueRegistration,
    ) {
  • crates/lakekeeper/src/service/task_queue/mod.rs, lines ~205–221 (the register_built_in_queues method)
    • Change

    pub async fn register_built_in_queues<…>(
        &mut self,
        …,
    ) -> &mut Self {
        …
        self.register_queue::<…>(…).await;
        self.register_queue::<…>(…).await;
        self
    }

    to

    pub async fn register_built_in_queues<…>(
        &self,
        …,
    ) {
        …
        self.register_queue::<…>(…).await;
        self.register_queue::<…>(…).await;
        // no return
    }

Re-run cargo check to confirm the compilation issue is resolved and update any documentation/examples if they reference the old return type.

🤖 Prompt for AI Agents
crates/lakekeeper/src/service/task_queue/mod.rs around lines 186–191 (and
similarly ~205–221): the async methods register_queue and
register_built_in_queues currently take &mut self and return &mut Self which
cannot compile because async fns cannot return borrowed references to self
across await points; change their signatures to take &self and return () (i.e.,
remove the &mut self parameter and the &mut Self return type), update the
internal calls accordingly (they already use interior mutability via
Arc<RwLock<…>> so no other logic change is required), and run cargo check to
verify compilation; also remove the final self return in
register_built_in_queues and any call-site expectations of a returned &mut Self.

@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: 1

♻️ Duplicate comments (2)
crates/lakekeeper/src/service/task_queue/mod.rs (2)

186-218: Async method returning &Self will not compile; return a non-borrowing type (e.g., ())

An async fn cannot return references tied to self because the future must be able to live independently of the borrow across .await points. This applies even to &Self. The body already uses interior mutability, so returning &Self is unnecessary.

Convert the return type to () (or bool to indicate replacement), and drop the trailing self.

Apply:

-    pub async fn register_queue<T: QueueConfig>(&self, task_queue: QueueRegistration) -> &Self {
+    pub async fn register_queue<T: QueueConfig>(&self, task_queue: QueueRegistration) {
@@
-        self
+        // no return value
     }

220-269: Same issue in register_built_in_queues: async fn must not return &Self

This method awaits and also returns &Self. Switch to returning () and remove the tail self.

Apply:

-    pub async fn register_built_in_queues<C: Catalog, S: SecretStore, A: Authorizer>(
-        &self,
-        catalog_state: C::State,
-        secret_store: S,
-        authorizer: A,
-        poll_interval: Duration,
-    ) -> &Self {
+    pub async fn register_built_in_queues<C: Catalog, S: SecretStore, A: Authorizer>(
+        &self,
+        catalog_state: C::State,
+        secret_store: S,
+        authorizer: A,
+        poll_interval: Duration,
+    ) {
@@
-        .await;
-
-        self
+        .await;
+        // no return value
     }
🧹 Nitpick comments (3)
crates/lakekeeper/src/service/task_queue/mod.rs (1)

662-709: Polling loop handles cancellation and jitter well; consider backoff tweak (optional)

Current behavior uses fixed 5s on errors and jittered poll_interval on empty polls. If noisy errors are expected, consider exponential backoff with an upper bound to reduce logs and DB pressure.

crates/lakekeeper/src/tests/mod.rs (2)

301-318: Typo: rename spawn_build_in_queues to spawn_built_in_queues (and update call sites)

Minor naming nit: “built-in” rather than “build-in”. Improves readability and discoverability.

Suggested diff (function name only; remember to update imports/callers):

-pub(crate) async fn spawn_build_in_queues<T: Authorizer>(
+pub(crate) async fn spawn_built_in_queues<T: Authorizer>(

301-318: Optional: reuse the same TaskQueueRegistry instance used to populate registered_task_queues

get_api_context builds state from a fresh TaskQueueRegistry, while spawn_built_*_queues creates another fresh registry to run workers. Although functionally fine, using a single shared registry would guarantee perfect parity between the running workers and management API views in tests.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 11892b7 and 3169500.

📒 Files selected for processing (4)
  • crates/lakekeeper/src/serve.rs (7 hunks)
  • crates/lakekeeper/src/service/task_queue/mod.rs (14 hunks)
  • crates/lakekeeper/src/tests/mod.rs (3 hunks)
  • crates/lakekeeper/src/tests/tasks.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: sqlx-check
  • GitHub Check: docker / docker
  • GitHub Check: clippy
  • GitHub Check: test
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: security_audit
🔇 Additional comments (8)
crates/lakekeeper/src/service/task_queue/mod.rs (3)

271-280: Good use of shared interior mutability for state propagation

Cloning the Arc<RwLock<...>> into RegisteredTaskQueues guarantees that later registrations are visible to pre-existing holders. The inline comment explains the intent well.


294-319: Lock ordering consistent and one-pass snapshot build is sound

Acquiring read locks on registered_queues then task_workers matches the write-side order in register_queue, avoiding lock-order inversions. Building a plain HashMap snapshot before starting workers keeps the runner immutable and simplifies restart logic.


989-998: Compile-time validation helper is tidy

valid_max_time_since_last_heartbeat as a const fn with asserts prevents invalid configs at compile time. Nice touch.

crates/lakekeeper/src/serve.rs (2)

230-244: Nice consolidation: single ApiContext<State<...>> passed to both router and registrars

Unifying wiring around ApiContext<State<A, C, S>> reduces parameter drift and keeps registrars aligned with the same view of state (including shared RegisteredTaskQueues). This supports the PR goal directly.


327-339: Task workers bootstrap looks solid; early skip avoids idle monitor

You build the runner once, then skip spawning the monitor if no queues are registered. Clean control-flow and logging.

crates/lakekeeper/src/tests/tasks.rs (2)

63-95: Tests correctly adopt async registration and the new worker signature

  • TaskQueueRegistry::new() used immutably with .register_queue(...).await is consistent with interior mutability.
  • Worker closure accepts the CancellationToken (even if unused in this test), matching the updated type alias.

140-146: Runner awaiting pattern is correct; readable sequencing

Awaiting task_queues_runner(...) before .run_queue_workers(false) ensures the runner snapshot is fully constructed prior to spawn. Clear and correct.

crates/lakekeeper/src/tests/mod.rs (1)

268-296: Asynchronous get_api_context aligns with the new async queue registration flow

Switching get_api_context to async to await built-in queue registration keeps test setup deterministic and avoids races in API exposure.

Comment thread crates/lakekeeper/src/serve.rs Resolved

@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: 1

♻️ Duplicate comments (1)
crates/lakekeeper/src/serve.rs (1)

382-384: Good: registrars are now async and awaited.

This addresses the earlier review about making external task-queue registration async-capable and awaiting it at the call site.

🧹 Nitpick comments (4)
crates/lakekeeper/src/serve.rs (4)

199-203: Remove duplicate cancellation.

cancellation_token.cancel() is invoked twice back-to-back.

-    tracing::debug!("Sending shutdown signal to threads");
-    cancellation_token.cancel();
+    tracing::debug!("Sending shutdown signal to threads");

47-49: Prefer 'static future for task-queue registrars.

RegisterTaskQueueFn doesn’t need to borrow inputs; returning BoxFuture<'static, _> simplifies usage and object safety for external implementers.

-    dyn Fn(&TaskQueueRegistry, ApiContext<State<A, C, S>>) -> BoxFuture<'_, anyhow::Result<()>>,
+    dyn Fn(&TaskQueueRegistry, ApiContext<State<A, C, S>>) -> BoxFuture<'static, anyhow::Result<()>>,

39-45: Background-service registrar API: return task Ids, not AbortHandles, and avoid borrowing JoinSet across await.

  • You’re collecting names keyed by tokio::task::Id later; returning AbortHandle is unnecessary and couples the API to a specific abort mechanism. Returning (String, Id) is simpler; you already call JoinSet::abort_all() on timeout anyway.
  • Since the alias returns BoxFuture<'_>, ensure implementers don’t hold &mut JoinSet across an await.

Proposed API tweak:

-    ) -> BoxFuture<'_, anyhow::Result<Vec<(String, AbortHandle)>>>,
+    ) -> BoxFuture<'_, anyhow::Result<Vec<(String, tokio::task::Id)>>>,

And usage:

-    for (service_name, abort_handle) in abort_handles {
-        tracing::info!("Spawned background service: {service_name}");
-        service_ids.insert(abort_handle.id(), service_name);
-    }
+    for (service_name, id) in abort_handles {
+        tracing::info!("Spawned background service: {service_name}");
+        service_ids.insert(id, service_name);
+    }

Verification notes:

  • Ensure no registrar needs the AbortHandle explicitly.
  • In registrars, spawn tasks first, capture their id(), then perform any awaits (don’t keep &mut JoinSet borrowed over an await). If needed, split into smaller async blocks.

Also applies to: 438-447


489-492: Treat “no services started” as an error.

This path should surface a failure; currently it logs an error but returns Ok(()).

-        tracing::error!("No services were started, exiting.");
-        Ok(())
+        Err(anyhow!("No services were started; exiting"))
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec2034 and bebb228.

📒 Files selected for processing (1)
  • crates/lakekeeper/src/serve.rs (9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
crates/lakekeeper/src/serve.rs (3)
crates/lakekeeper/src/service/task_queue/mod.rs (5)
  • task (624-624)
  • task (636-636)
  • len (283-285)
  • new (179-184)
  • registered_task_queues (273-280)
crates/lakekeeper/src/api/router.rs (2)
  • new_full_router (79-158)
  • serve (226-239)
crates/lakekeeper/src/api/mod.rs (3)
  • shutdown_signal (27-75)
  • std (53-53)
  • std (56-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: docker / docker
  • GitHub Check: security_audit
  • GitHub Check: check-generated-openapi-matches
  • GitHub Check: test
  • GitHub Check: clippy
  • GitHub Check: sqlx-check

Comment thread crates/lakekeeper/src/serve.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR match the correct format. Thank you!

@c-thiel
c-thiel merged commit 7977b45 into main Aug 27, 2025
@c-thiel
c-thiel deleted the ct/register-tasks-interior-mutability branch August 27, 2025 10:16
@c-thiel c-thiel mentioned this pull request Aug 27, 2025
mrjoe7 added a commit to mrjoe7/lakekeeper that referenced this pull request Oct 30, 2025
* feat: Publish images to Dockerhub (lakekeeper#1274)

* feat: Update UI to 0.9.0 with multi-project support (lakekeeper#1275)

* chore: release 0.9.4

Release-As: 0.9.4

* chore: release main (lakekeeper#1262)

* chore(ci): Fix Dockerhub login

* chore(docs): Improve developer guide (lakekeeper#1265)

* chore(docs): add info regarding `view_version`'s internal representation (lakekeeper#1261)

* chore(docs): Architecture clarify Secret Store (lakekeeper#1284)

* fix: Update Limes to 0.2.2 - Fixes compilation issue due to breaking `jwks_client_rs` change (lakekeeper#1282)

* fix: Update Limes to 0.2.2

* increase min rust version

* chore: release 0.9.5

Release-As: 0.9.5

* chore: release main (lakekeeper#1286)

* chore: enable changelog sections for release-please (lakekeeper#1264)

k

* fix(deps): update rust crate rand to v0.9.2 (lakekeeper#1252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-channel to v2.5.0 (lakekeeper#1225)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency mkdocs-material to v9.6.17 (lakekeeper#1289)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate anyhow to v1.0.99 (lakekeeper#1290)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Remove bitnami images (lakekeeper#1288)

* feat!: Move to Lakekeeper IO based on hyperscaler SDKs (lakekeeper#1285)

* chore(deps): update rust crate reqwest to v0.12.23 (lakekeeper#1294)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): Improve Cloud storage test docs

* fix: accept "disable" as PG sslmode as documented (lakekeeper#1303)

* feat: Simplify task interface, re-exports, enable delete-after-commit (lakekeeper#1302)

* feat: Introduce `RequestMetadata` for Internal Principals which bypass AuthZ (lakekeeper#1306)

* chore(deps): update azure/setup-helm action to v4.3.1 (lakekeeper#1299)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(test): use nextest filterset instead of needs_env_var (lakekeeper#1304)

* chore(deps): update rust crate openssl-src to v300.5.2 (lakekeeper#1292)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-compression to v0.4.28 (lakekeeper#1311)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate thiserror to v2.0.16 (lakekeeper#1296)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Provide `ApiContext` to externally registered tasks (lakekeeper#1307)

* feat!: Simplify Task interface, extend SpecializedTask interface (lakekeeper#1310)

* feat: Improve authorizer `are_allowed_*` batch check signature (lakekeeper#1315)

* chore(authz): Enforce use of AuthZ decisions with #[must_use] (lakekeeper#1317)

* feat: Task Management APIs (lakekeeper#1316)

* chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] (lakekeeper#1318)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Add `RunNow` and `RunAt` to Controls for Tasks (lakekeeper#1322)

* chore(deps): update rust crate tokio-util to v0.7.16 (lakekeeper#1313)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(docs): Improve Entra ID docs (lakekeeper#1325)

* chore(docs): Improve Upgrades & Migration docs (lakekeeper#1326)

* feat: Add tasks heartbeat with Catalog state (lakekeeper#1324)

* ci: add configuration for CodeRabbit reviews (lakekeeper#1327)

* feat: Add optional STS session-tags in S3 STS requests for ABAC authorization (lakekeeper#1230)

* feat: Random Server IDs (lakekeeper#1328)

* chore(deps): update rust crate percent-encoding to v2.3.2 (lakekeeper#1312)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(authz): Deprecate Permission Endpoints for Tables without WarehouseIDs (lakekeeper#1334)

* fix: Tasks endpoints in router (lakekeeper#1335)

* feat(ci): add nextest profile ci_no_secrets for external PRs (lakekeeper#1333)

* chore(deps): update rust crate chrono to v0.4.42 (lakekeeper#1331)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Pin examples duckdb version to 1.3 (lakekeeper#1343)

* feat!: Require warehouse_id when checking permissions on views or tables via ID (lakekeeper#1340)

* fix: migrate away from bitnami in unittest.yml (lakekeeper#1344)

* chore: Remove coderabitt config

* fix(docs): Fix inconsistent URL format in README (lakekeeper#1345)

Co-authored-by: Christian <[email protected]>

* feat: Remove serde_yaml & serde_yml (lakekeeper#1341)

* feat!: add `warehouse_id` to PKs of all `table_*` and `view_*` tables (lakekeeper#1254)

* feat: Minor namespace join performance improvements

* fix: Warehouse permissions are directly used for task retrieval & control (lakekeeper#1347)

* fix: Potential Race Condition when undropping Tabulars (lakekeeper#1342)

* fix: table rename authz and error handling (lakekeeper#1346)

Co-authored-by: Andre Luis Anastacio <[email protected]>

* chore(deps): update rust crate google-cloud-auth to v1.1.2 (lakekeeper#1337)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate time to v0.3.44 (lakekeeper#1349)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency mkdocs-material to v9.6.20 (lakekeeper#1309)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* feat: Set ServerID during migration (lakekeeper#1348)

* chore(deps): Remove utoipa fork (lakekeeper#1352)

* chore(deps): update rust crate serde_with to v3.14.1 (lakekeeper#1351)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate url to v2.5.7 (lakekeeper#1354)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-compression to v0.4.30 (lakekeeper#1323)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate serde_json to v1.0.145 (lakekeeper#1250)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update strum monorepo to v0.27.2 (lakekeeper#1251)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update serde monorepo to v1.0.226 (lakekeeper#1355)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update rust crate clap to v4.5.48 (lakekeeper#1356)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Add Entity Names to Tasks (lakekeeper#1353)

* fix: case insensitivity of catalog endpoints (lakekeeper#1338)

* fix: Improve delete_warehouse error message for active tasks

* chore(deps): update rust crate tempfile to v3.22.0 (lakekeeper#1359)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Christian <[email protected]>

* chore(deps): update rust crate axum-prometheus to 0.9.0 (lakekeeper#1358)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: PgSslMode not supported error string

* feat(authz)!: add OpenFGA schema v4 and v3->v4 migration (lakekeeper#1314)

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>

* chore(deps): update rust crate uuid to v1.18.1 (lakekeeper#1362)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency markdown-grid-tables to v0.6.0 (lakekeeper#1357)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate anyhow to v1.0.100 (lakekeeper#1350)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: clippy

* chore(deps): update rust crate moka to v0.12.11 (lakekeeper#1365)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate tempfile to v3.23.0 (lakekeeper#1367)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update rust crate async-nats to 0.43.0 (lakekeeper#1366)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-node action to v5 (lakekeeper#1371)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/checkout action to v5 (lakekeeper#1369)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update actions/setup-python action to v6 (lakekeeper#1372)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: V3 support (lakekeeper#1364)

* chore: Set Get Task Permission to "CanGetMetadata" (lakekeeper#1376)

* chore(deps): update dependency node to v22 (lakekeeper#1373)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(authz)!: extend OpenFGA tabular entities with WarehouseId (lakekeeper#1329)


---------

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>

* feat: Add support for tasks affecting views (lakekeeper#1378)

* feat(authz): Add specific Task Actions (lakekeeper#1379)

* chore(tests): Test with Iceberg 1.9.2 & 1.10.0 (lakekeeper#1267)

* feat: Enrich task metadata with concrete tabular type (lakekeeper#1383)

* feat: Add loadTable Snapshots filter (lakekeeper#1385)

* feat: add endpoint for fuzzy search of tabulars (lakekeeper#1387)

* feat: Update UI to 0.10.0 (lakekeeper#1390)

* feat(ui): Update UI to 0.10.1

* chore: Use lakekeeper re-exports in bin (lakekeeper#1391)

* fix(tabular-search): distance and docs for `searchterm is uuid` (lakekeeper#1393)

* chore(examples): Idempotent bucket creation in minimal example (lakekeeper#1386)

In the case where you already have a bucket created, like the "examples" bucket, I ran into an issue where the createbuckets service fails, and this prevents lakekeeper from starting back up.

This fix adds a simple minio flag to ignore buckets that already exist, making things even more user friendly

* feat: Make number of workers spawned for Expiration & Purge configurable (lakekeeper#1395)

* chore: release main (lakekeeper#1295)

* chore: added gif to readme (lakekeeper#1396)

* chore: remove unneded `#[allow(dead_code)]` (lakekeeper#1399)

* fix: Use FnOnce for queue & service registration

* Revert "fix: Use FnOnce for queue & service registration"

This reverts commit 47b03a0.

* chore(docs): Add 0.10 docs

* perf(db): remove `join namespace` from `active_tabulars` view (lakekeeper#1401)

* doc(db): how to connect to db and inspect schema (lakekeeper#1402)

* feat: implement `OpenFgaEntity` for `ServerId` (lakekeeper#1394)

* impl OpenFgaEntity
* Use the implementation

* fix: Use FnOnce for queue & service registration (lakekeeper#1404)

* chore(deps): update dependency mkdocs-material to v9.6.21 (lakekeeper#1406)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Expose client-managed X-Iceberg-Access-Delegation (lakekeeper#1407)

* fix: Use higher consistency for some OpenFGA queries (lakekeeper#1408)

* feat: Improve Kubernetes Auth docs (lakekeeper#1415)

* chore: release 0.10.1

Release-As: 0.10.1

* fix: Endpoint stats for Project Endpoints (lakekeeper#1412)

* feat: Add create table guard to cleanup location on Failure (lakekeeper#1418)

* chore: Generate ID types with Macro (lakekeeper#1419)

* chore: Re-Export Tokio from lakekeeper-io create (lakekeeper#1420)

* fix: Add support for `write.metadata.metrics.` Table Properties (lakekeeper#1422)

* fix: Update UI to 0.10.2 (lakekeeper#1423)

* chore: release main (lakekeeper#1403)

* fix: Parse empty ProjectID headers as None (lakekeeper#1424)

* chore: release 0.10.2

Release-As: 0.10.2

* chore: release main (lakekeeper#1425)

* feat: Add `debug_migrate_before_serve` env var (lakekeeper#1426)

* feat: Move OpenFGA Authorizer to separate crate (lakekeeper#1421)

* chore(renovate): Group dependencies

* chore(renovate): ignore additional deps

* chore: Rename src/service -> src/server, trait Catalog -> CatalogStore (lakekeeper#1428)

* feat(examples): add k8s iceberg sink connector (avro) (lakekeeper#1336)


---------

Co-authored-by: Christian <[email protected]>

* chore(ci): Fix release please (lakekeeper#1433)

* feat: Expose License Information via API (lakekeeper#1432)

* fix(deps): update all non-major dependencies (lakekeeper#1429)

* chore(ci): Remove mgmt API version update via release-please

* chore: Restructure catalog_store into multiple modules (lakekeeper#1434)

* feat: Validate Downscoping works on Warehouse creation (lakekeeper#1437)

* chore(ci): Fix release please

* docs: Add info about installing sqlx to developer-guide.md (lakekeeper#1438)

* docs: Update developer-guide.md (lakekeeper#1439)

* chore(deps): update all non-major dependencies (lakekeeper#1436)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: Better normalization for ARNs in S3 Profile (lakekeeper#1441)

* chore(deps): update all non-major dependencies (lakekeeper#1442)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(main): release 0.10.3 (lakekeeper#1427)

* fix: Release Please CI outputs

* fix(ci): Revert 0.10.3 release

* chore(main): release 0.10.3 (lakekeeper#1446)

* feat: Introduce CatalogWarehouseOps & CatalogNamespaceOps abstractions (lakekeeper#1440)

* feat: Allow x-user-agent header (lakekeeper#1453)

* feat: Table & View Ops Abstractions, Improved Error Handling (lakekeeper#1454)

* fix: CORS allow access delegation & etag headers (lakekeeper#1455)

* fix: Headers should be lowercase (lakekeeper#1457)

* chore(tests): Add trino information_schema.tables test (lakekeeper#1456)

* chore: Introduce open-api feature to gate utoipa and swagger (lakekeeper#1458)

* chore: Release As 0.11

* fix: Debug assertion table identifier mismatch for signer (lakekeeper#1460)

* feat: Caching Short-Term-Credentials (STC) (lakekeeper#1459)

* feat: Warehouse Cache (lakekeeper#1462)

* chore(deps): update actions/setup-node action to v6 (lakekeeper#1443)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: Version based Warehouse Cache (lakekeeper#1465)

* feat: AuthZ Server and Project Ops (lakekeeper#1471)

* chore(deps): update github artifact actions (lakekeeper#1461)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore: Rename release branch pattern to rel-*

* feat: Catalog returns full Namespace Hierarchy for nested Namespaces (lakekeeper#1472)

---------

Co-authored-by: Christian <[email protected]>
Co-authored-by: Christian Thiel <[email protected]>
Co-authored-by: Dao Thanh Tung <[email protected]>
Co-authored-by: Moritz Zielke <[email protected]>
Co-authored-by: Baptiste Gouhoury <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dolan Antenucci <[email protected]>
Co-authored-by: Anatoly Popov <[email protected]>
Co-authored-by: Andre Luis Anastacio <[email protected]>
Co-authored-by: Scott Haines <[email protected]>
Co-authored-by: Viktor Kessler <[email protected]>
Co-authored-by: Yohan Valencia <[email protected]>
Co-authored-by: Paul Roman <[email protected]>
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