Skip to content

Conversation

@ByteBaker
Copy link
Contributor

No description provided.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 3, 2025

Greptile Overview

Greptile Summary

Cleaned up redundant async move wrappers when spawning async functions that already return futures

  • Simplified ~35 tokio::spawn calls across job initialization, ingester writer, alert manager, compactor, and stats modules
  • One inconsistency: line 230 in src/job/mod.rs still uses old syntax for enterprise domain management watcher

Confidence Score: 5/5

  • Safe to merge - purely stylistic cleanup with no functional changes
  • Changes are semantically identical to the previous code, just removing unnecessary async wrappers. The refactor improves code clarity by directly passing futures to tokio::spawn instead of wrapping them in redundant async blocks.
  • No files require special attention - all changes are safe refactoring

Important Files Changed

File Analysis

Filename Score Overview
src/ingester/src/writer.rs 5/5 Removed redundant async move wrapper when spawning consume_loop - the function already returns a future
src/job/alert_manager.rs 5/5 Simplified spawn call for run_schedule_jobs() by removing unnecessary async wrapper
src/job/compactor.rs 5/5 Removed redundant async wrapper for run_enrichment_table_merge() spawn call
src/job/mod.rs 5/5 Updated ~30 spawn calls to remove unnecessary async wrappers
src/job/stats.rs 5/5 Simplified spawn calls for memory and disk usage monitoring functions

Sequence Diagram

sequenceDiagram
    participant Main as Main Thread
    participant Runtime as Tokio Runtime
    participant Task as Spawned Task
    
    Note over Main: Before (Redundant Wrapper)
    Main->>Runtime: tokio::spawn(async move { fn().await })
    Runtime->>Runtime: Create unnecessary async block
    Runtime->>Task: Execute async function
    Task-->>Runtime: Future completes
    
    Note over Main: After (Direct Spawn)
    Main->>Runtime: tokio::spawn(fn())
    Runtime->>Task: Execute async function directly
    Task-->>Runtime: Future completes
    
    Note over Main,Task: The async function already returns a Future<br/>No need for additional async wrapper
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@openobserve openobserve deleted a comment from github-actions bot Dec 3, 2025
@ByteBaker ByteBaker merged commit 012e720 into main Dec 3, 2025
39 checks passed
@ByteBaker ByteBaker deleted the chore/cleanup branch December 3, 2025 14:06
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.

3 participants