analysis: pipeline architecture flaws - why it cannot complete
Critical flaws: 1. Data flow inconsistency (face.json → workspace.sqlite broken) 2. Status check flaw (doesn't verify data integrity) 3. Infinite wait (no timeout for missing files) 4. Scattered state (DB + Redis + files + memory) 5. Insufficient error handling (no auto-repair, no retry limits) Root causes: - Data flow broken between stages - Status management chaotic - No atomic state updates - Monitoring lacking Recommendations: - Short-term: add integrity checks, timeout, error reporting - Long-term: unified state management, robust pipeline, monitoring Impact: pipeline frequently stuck, hard to diagnose/recover
This commit is contained in:
@@ -0,0 +1,117 @@
|
|||||||
|
---
|
||||||
|
title: Pipeline Architecture Flaws Analysis
|
||||||
|
version: 1.0
|
||||||
|
date: 2026-09-27
|
||||||
|
author: OpenCode
|
||||||
|
status: critical
|
||||||
|
---
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Pipeline unable to complete due to multiple architectural flaws.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Pipeline Flow
|
||||||
|
|
||||||
|
**Phase 1:** ASR, ASRX, Face, OCR, Pose, CUT, Scene VLM
|
||||||
|
**Phase 2:** Face Tracing, Face Dedup, TKG, Rule Ingestion
|
||||||
|
|
||||||
|
**Dependency:** Face Detection → Face Tracing → Face Dedup → TKG
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Critical Flaws
|
||||||
|
|
||||||
|
### 1. Data Flow Inconsistency
|
||||||
|
|
||||||
|
- Face Detection outputs to `face.json`
|
||||||
|
- Face Tracing reads from `workspace.sqlite`
|
||||||
|
- No automatic conversion
|
||||||
|
|
||||||
|
**Result:** Data lost between stages
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 2. Status Check Flaw
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// ❌ Current
|
||||||
|
if face_traced_json.exists() { skip }
|
||||||
|
|
||||||
|
// ✅ Should
|
||||||
|
if all_files_exist && data_complete { skip }
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 3. Infinite Wait
|
||||||
|
|
||||||
|
- Worker waits for 15 missing files
|
||||||
|
- No timeout
|
||||||
|
- No error reporting
|
||||||
|
- Never completes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 4. Scattered State
|
||||||
|
|
||||||
|
- PostgreSQL `processing_status`
|
||||||
|
- Redis
|
||||||
|
- File system (face_traced.json)
|
||||||
|
- Worker memory
|
||||||
|
|
||||||
|
**Problem:** No single source of truth
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5. Insufficient Error Handling
|
||||||
|
|
||||||
|
- No data integrity check
|
||||||
|
- No auto-repair
|
||||||
|
- No user-visible errors
|
||||||
|
- No retry limits
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Root Causes
|
||||||
|
|
||||||
|
1. Data flow broken between stages
|
||||||
|
2. Status management chaotic
|
||||||
|
3. Error handling insufficient
|
||||||
|
4. Monitoring lacking
|
||||||
|
5. No atomic state updates
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Recommendations
|
||||||
|
|
||||||
|
### Short-term
|
||||||
|
|
||||||
|
1. Add data integrity checks
|
||||||
|
2. Add timeout/retry limits
|
||||||
|
3. Improve error reporting
|
||||||
|
|
||||||
|
### Long-term
|
||||||
|
|
||||||
|
1. Unified state management (PostgreSQL only)
|
||||||
|
2. Unified data pipeline
|
||||||
|
3. Robustness design (timeout + recovery)
|
||||||
|
4. Monitoring + alerting
|
||||||
|
5. Test coverage
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Impact
|
||||||
|
|
||||||
|
- Pipeline frequently stuck
|
||||||
|
- Hard to diagnose
|
||||||
|
- Hard to recover
|
||||||
|
- Poor user experience
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- `2026-09-27_020mp4_root_cause_zombie_worker.md`
|
||||||
|
- `2026-09-27_020mp4_stuck_analysis.md`
|
||||||
Reference in New Issue
Block a user