Conversation
…een file Create and Remove events that could cause duplicate FileTrackers or reading from already-removed files.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces atomic event handling mechanisms across multiple system components. It bumps the version from 0.3.0 to 0.4.0, removes the increment-version Makefile dependency to enable Docker tag pushing, updates documentation, adds Dead Letter Queue retry logic with configurable max retry counts and batch operations, implements a DLQ background retry task with exponential backoff, refactors sender retry behavior using a 50-attempt loop instead of fixed timeouts, extends bounded channels with non-blocking send capability, and refactors file watcher event handling to use atomic collection patterns that eliminate race conditions. Changes
Sequence DiagramsequenceDiagram
participant WP as EsWorkerPool
participant DLQ as DeadLetterQueue
participant ES as Elasticsearch
participant Backoff as Backoff Strategy
Note over WP,Backoff: DLQ Retry Background Task (Periodic)
WP->>DLQ: take_batch(limit)
activate DLQ
DLQ-->>WP: batch of failed events
deactivate DLQ
WP->>WP: build ndjson bulk payload
WP->>Backoff: get current retry interval
rect rgba(100, 150, 200, 0.2)
Note over WP,ES: POST with Backoff & Timeout Handling
WP->>ES: POST bulk request
alt Success
ES-->>WP: 200 OK
WP->>DLQ: mark_recovered(count)
WP->>Backoff: reset to base interval
else Timeout or Error
WP-->>WP: increment backoff interval
WP->>DLQ: return_failed(events)
activate DLQ
DLQ->>DLQ: retry_count++ per event<br/>re-queue if retry_count ≤ max
deactivate DLQ
end
end
sequenceDiagram
participant FS as Filesystem
participant W as Watcher
participant ST as AppState Lock
participant CH as Bounded Channel
Note over W: Atomic Create Event Handling
FS->>W: file created
activate W
W->>ST: acquire lock (single operation)
W->>W: create FileTracker
W->>W: collect historical events<br/>(respect MAX_BATCH_SIZE)
W->>ST: release lock
deactivate W
W->>W: insert tracker into file_trackers
W->>CH: send collected events batch
Note over W: Atomic Remove Event Handling
FS->>W: file removed
activate W
W->>W: remove tracker from file_trackers
W->>ST: acquire lock (read remaining)
W->>W: collect remaining content<br/>(respect MAX_BATCH_SIZE)
W->>ST: close tracker & cleanup
W->>ST: release lock
deactivate W
W->>CH: send remaining events batch
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (9)
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. Comment |
Summary by CodeRabbit
Release Notes v0.4.0
New Features
Improvements
Requirements
✏️ Tip: You can customize this high-level summary in your review settings.