The queue system is the heart of Rediacc, managing task distribution across machines.
Overview
The queue manages tasks with the following lifecycle:
PENDING β ASSIGNED β PROCESSING β COMPLETED/FAILED/CANCELLED
States
- PENDING - Task created, waiting to be picked up by a bridge
- ASSIGNED - Bridge has claimed the task and is preparing execution
- PROCESSING - Task is currently running on the machine
- COMPLETED - Task finished successfully
- FAILED - Task encountered an error
- CANCELLED - Task was manually cancelled
Task Properties
Each queue item has:
| Property | Type | Description |
|---|---|---|
taskId | UUID | Unique task identifier |
status | Enum | Current execution state |
priority | 1-5 | Execution priority (1 highest) |
retryCount | Number | Remaining retry attempts |
vaultData | Object | Encrypted task configuration |
output | String | Task execution output |
error | String | Error message if failed |
createdAt | Timestamp | Task creation time |
completedAt | Timestamp | Task completion time |
Priority System
Tasks are processed in priority order:
- P1 (Critical) - Immediate execution (emergency, security)
- P2 (High) - Execute within minutes (deployments)
- P3 (Normal) - Execute within hours (standard tasks)
- P4 (Low) - Background work (maintenance)
- P5 (Minimal) - Whenever resources available (cleanup)
Example
# Create high-priority task
./rediacc create task \
--machine prod-01 \
--priority 1 \
--command "systemctl restart app"
Retry Mechanism
Failed tasks can be automatically retried:
{
"taskId": "550e8400-e29b-41d4-a716-446655440000",
"retryCount": 3,
"retryDelay": 30,
"maxRetries": 3
}
Configure retry behavior:
retryCount- Number of remaining retriesretryDelay- Seconds between retry attemptsmaxRetries- Maximum retry attempts allowed
Monitoring Queue
Check Queue Status
./rediacc list queue
./rediacc list queue --status PENDING
./rediacc list queue --team Production
Monitor Specific Task
./rediacc inspect queue task-123
Real-time Monitoring
Use the web console for real-time queue updates and visualization.
Vault Data
Tasks can include encrypted configuration:
{
"vaultData": {
"function": "deploy",
"repository": "web-app",
"version": "1.2.3",
"environment": "production",
"credentials": {
"ssh_key": "[encrypted]",
"api_token": "[encrypted]"
}
}
}
Vault data is automatically encrypted/decrypted by the system.
Batch Operations
Process multiple tasks efficiently:
# Get next 5 tasks
./rediacc list queue --limit 5
# Cancel multiple tasks
./rediacc cancel queue task-1 task-2 task-3 --confirm
Queue Best Practices
- Monitor queue depth - Alert if queue grows too large
- Set appropriate priorities - Donβt overuse priority 1
- Use batching - Group related tasks
- Configure retries wisely - Balance reliability vs. resource usage
- Archive completed tasks - Keep queue clean
Troubleshooting
Tasks Stuck in PROCESSING
If a task is stuck:
- Check bridge status
- Verify machine SSH connectivity
- Review task logs for errors
- Manually cancel if necessary
High Queue Backlog
If queue is growing:
- Check bridge capacity
- Verify machine resources
- Increase
batch_sizein bridge configuration - Add more bridges or machines
Task Failures
Always check:
- Task error message
- Machine logs
- Vault data integrity
- SSH connectivity
Learn more in Best Practices.