fix: increase storage API timeout from 15s to 30s (addresses #448)

The 15-second timeout introduced to handle unavailable NFS storage was too aggressive and caused legitimate storage queries to timeout on nodes with many storage backends or higher latency. This was causing storage to not be displayed for affected nodes.

Increased timeout to 30 seconds as a better balance between responsiveness and reliability.
This commit is contained in:
Pulse Monitor
2025-09-11 14:19:21 +00:00
parent ba4eb34e4f
commit 082383a4dc
2 changed files with 57 additions and 6 deletions
+48
View File
@@ -0,0 +1,48 @@
## Note for RC versions
This is a pre-release version for testing. Consider backing up your Pulse configuration before updating.
## What's Changed
### Improvements
- **Enhanced diagnostics export** - Now includes critical troubleshooting data:
- Backend diagnostics when available
- Node online/offline status
- Physical disks information
- ZFS pool health details
- Alert configuration
- Connection health metrics
- Helps identify issues like missing storage, timeout errors, and threshold save problems
### Documentation
- Added GitHub issue templates with diagnostics export instructions
- Templates guide users to provide better information when reporting issues
### Why this matters
This release significantly improves troubleshooting capabilities. The enhanced diagnostics export will help identify and resolve issues like:
- Storage only showing from one node (when others timeout)
- 504 errors when saving thresholds
- Missing physical disk information
- Alert configuration problems
## Testing v4.15.0-rc.6
**Install script:**
```bash
curl -fsSL https://raw.githubusercontent.com/rcourtman/Pulse/main/install.sh | bash -s -- --version v4.15.0-rc.6
```
**Docker:**
```bash
docker pull rcourtman/pulse:v4.15.0-rc.6
docker run -d --name pulse -p 7655:7655 -v pulse-data:/etc/pulse rcourtman/pulse:v4.15.0-rc.6
```
## How to provide feedback
If you're still experiencing issues after updating:
1. Go to Settings → Diagnostics tab
2. Click "Run Diagnostics" first
3. Then click "Export for GitHub"
4. Attach the exported file to your issue report
## Downloads
Pre-built binaries available below for linux-amd64, linux-arm64, and linux-armv7.
+9 -6
View File
@@ -559,10 +559,11 @@ func (c *Client) GetStorage(ctx context.Context, node string) ([]Storage, error)
// Storage queries can take longer on large clusters or slow storage backends
// Create a new context with shorter timeout for storage API calls
// Storage endpoints can hang when NFS/network storage is unavailable
// Using 30s timeout as a balance between responsiveness and reliability
storageCtx := ctx
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 15*time.Second {
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 30*time.Second {
var cancel context.CancelFunc
storageCtx, cancel = context.WithTimeout(ctx, 15*time.Second)
storageCtx, cancel = context.WithTimeout(ctx, 30*time.Second)
defer cancel()
}
@@ -588,10 +589,11 @@ func (c *Client) GetAllStorage(ctx context.Context) ([]Storage, error) {
// Storage queries can take longer on large clusters
// Create a new context with shorter timeout for storage API calls
// Storage endpoints can hang when NFS/network storage is unavailable
// Using 30s timeout as a balance between responsiveness and reliability
storageCtx := ctx
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 15*time.Second {
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 30*time.Second {
var cancel context.CancelFunc
storageCtx, cancel = context.WithTimeout(ctx, 15*time.Second)
storageCtx, cancel = context.WithTimeout(ctx, 30*time.Second)
defer cancel()
}
@@ -682,10 +684,11 @@ func (c *Client) GetStorageContent(ctx context.Context, node, storage string) ([
// Storage content queries can take longer on large storages
// Create a new context with shorter timeout for storage API calls
// Storage endpoints can hang when NFS/network storage is unavailable
// Using 30s timeout as a balance between responsiveness and reliability
storageCtx := ctx
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 15*time.Second {
if deadline, ok := ctx.Deadline(); !ok || time.Until(deadline) > 30*time.Second {
var cancel context.CancelFunc
storageCtx, cancel = context.WithTimeout(ctx, 15*time.Second)
storageCtx, cancel = context.WithTimeout(ctx, 30*time.Second)
defer cancel()
}