feat: retry, concurrency control, and parallel DB optimizations#29
Open
feat: retry, concurrency control, and parallel DB optimizations#29
Conversation
…B layer - Add retry with exponential backoff (429/500/502/503/504 + network errors) to DeeplakeApi.query() — recovers transient failures that previously crashed sessions entirely - Add concurrency semaphore (max 5 in-flight requests) to prevent rate-limit cascading under load - Add retry to listTables() for resilient table setup - Parallelize flush in DeeplakeFs — upserts run via Promise.allSettled with failed writes re-queued for retry, throws on partial failure for durability - Parallelize bootstrap — sync + memory + sessions metadata load concurrently - Fix appendFile cache invalidation — content cache was stale after SQL append - Single-query grep in pre-tool-use hook — 6 HTTP round-trips reduced to 1 - Skip session bootstrap when sync fails to prevent stale data population Benchmark results (real plugin code against beta API): - Baseline crashed at 50+ concurrent sessions (0 retry, no backpressure) - Optimized handles 500 sessions at 0.1% error rate - QPS ~2x where both ran (parallel flush vs sequential) - Error rate dropped from 8-40% to 0.1-0.4% across all experiments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeeplakeApi.query()— the single highest-impact changeDeeplakeFsappendFilecache invalidation bug (stale reads after append)Benchmark results (real plugin code, beta API)
Test plan
🤖 Generated with Claude Code