-
Notifications
You must be signed in to change notification settings - Fork 3
Fix 30-day query failures with smart chunking and sampling #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rajsinghtech
merged 2 commits into
rajsinghtech:main
from
risingglory:fix-30day-query-chunking
Oct 2, 2025
Merged
Fix 30-day query failures with smart chunking and sampling #33
rajsinghtech
merged 2 commits into
rajsinghtech:main
from
risingglory:fix-30day-query-chunking
Oct 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add chunking for queries > 7 days to prevent timeouts - Implement smart sampling for large datasets (>50K logs) - Add dynamic timeouts based on query size - Improve field name compatibility for API variations - Add memory management to prevent server crashes Resolves issue rajsinghtech#3: Network View fails to load when Last 30 Days range selected Performance improvements: - 24h queries: Fast, direct processing - 7d queries: Optimized with longer timeouts - 30+ day queries: Chunked + sampled processing - Large networks: Handles 1000+ devices gracefully - Memory usage: Controlled and efficient
|
I love ai too 🚀, but have you tested this pr at all? I get these logs for larger ranges. |
- Increase timeout from 20min to 30min for large queries - Increase HTTP client timeout from 15min to 30min - Reduce chunk size from 3 days to 1 day to prevent individual chunk timeouts - This addresses the 'context deadline exceeded' errors reported by maintainer The smaller chunks with longer timeouts should resolve the timeout issues while still providing the benefits of chunking for large datasets.
|
ok, yeah that's way bigger than my tailnet atm :) happy i could be of some use at least👍 Also i see in your logs i think you are using the oauth key, while im using the api key, would that give a difference for you in timeouts ? might be worth a try :) |
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.


Problem
Resolves issue #3 - Network View fails to load when Last 30 Days range selected.
The application works fine for 24-hour and 7-day queries but fails with "Unable to Load Network Data" error for 30+ day queries due to:
Solution
This PR implements several improvements:
🚀 Smart Chunking
📊 Response Size Management
⏱️ Dynamic Timeouts
🔧 Field Name Compatibility
💾 Memory Management
Testing
Performance Impact
Backward Compatibility
Files Changed
backend/internal/handlers/handlers.go: Added chunking and sampling logicbackend/internal/services/tailscale.go: Added dynamic timeouts and memory managementfrontend/src/components/LogViewer.tsx: Added field name compatibilityfrontend/src/pages/NetworkView.tsx: Added robust response handling