docs: session summary - pipeline debugging and fixes
Work completed: 1. ✅ ASR common language polling feature 2. ✅ Pipeline architecture analysis 3. ✅ Worker data integrity fix 4. ✅ Zombie worker cleanup Issues found but not fixed: - Python script bug (face.json missing) - face_data is None in face_tracker.py - Pipeline stuck at 35% Key insights: - Multiple failure layers (Architecture → Worker → Python) - State in memory requires kill/restart - File existence ≠ data completeness Recommendations: - Short-term: fix Python error handling - Long-term: unified state management, retry mechanisms
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
---
|
||||
title: Session Summary - Pipeline Debugging and Fixes
|
||||
version: 1.0
|
||||
date: 2026-09-27
|
||||
author: OpenCode
|
||||
status: partially_complete
|
||||
---
|
||||
|
||||
## Session Overview
|
||||
|
||||
**Duration**: ~4 hours
|
||||
**Issues Addressed**: Multiple architectural and logic flaws
|
||||
**Status**: Worker fixed, Python script bug discovered
|
||||
|
||||
---
|
||||
|
||||
## Work Completed
|
||||
|
||||
### 1. ✅ ASR Language Detection
|
||||
|
||||
**Problem**: Whisper detected Japanese as Norwegian, output garbled text
|
||||
|
||||
**Solution**:
|
||||
- Added `--try-common-languages` flag
|
||||
- Quality scoring (avg_logprob, no_speech_prob, segments)
|
||||
- Polls en/zh/ja when auto-detection fails
|
||||
|
||||
**Files**:
|
||||
- `scripts/asr_processor.py`
|
||||
- `docs_v1.0/M4_workspace/2026-09-27_asr_common_language_polling.md`
|
||||
|
||||
---
|
||||
|
||||
### 2. ✅ Pipeline Architecture Analysis
|
||||
|
||||
**Problems Found**:
|
||||
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
|
||||
|
||||
**Documents**:
|
||||
- `2026-09-27_pipeline_architecture_flaws.md`
|
||||
|
||||
---
|
||||
|
||||
### 3. ✅ Worker Logic Fix
|
||||
|
||||
**Problem**: Worker only checked file existence, not data integrity
|
||||
|
||||
**Solution**:
|
||||
```rust
|
||||
// Before
|
||||
if face_traced_json.exists() { skip }
|
||||
|
||||
// After
|
||||
if face_traced_json.exists() &&
|
||||
traced_faces_dir.exists() &&
|
||||
file_count > 0 {
|
||||
skip
|
||||
} else {
|
||||
remove_incomplete_file()
|
||||
re_run()
|
||||
}
|
||||
```
|
||||
|
||||
**Files**:
|
||||
- `src/worker/job_worker.rs` lines 2782-2834
|
||||
- `docs_v1.0/M4_workspace/2026-09-27_worker_data_integrity_fix.md`
|
||||
|
||||
---
|
||||
|
||||
### 4. ✅ Zombie Worker Cleanup
|
||||
|
||||
**Problem**: Worker PID 16244 running non-existent binary for 5+ hours
|
||||
|
||||
**Solution**:
|
||||
- Killed zombie process
|
||||
- Started new worker with debug binary (PID 27196)
|
||||
- Reset database status
|
||||
|
||||
**Files**:
|
||||
- `docs_v1.0/M4_workspace/2026-09-27_020mp4_worker_repair_complete.md`
|
||||
|
||||
---
|
||||
|
||||
## Issues Found But Not Fixed
|
||||
|
||||
### ❌ Python Script Bug
|
||||
|
||||
**Problem**:
|
||||
- `face.json` file missing
|
||||
- `face_data` is `None` in `face_tracker.py`
|
||||
- `AttributeError: 'NoneType' object has no attribute 'get'`
|
||||
|
||||
**Impact**: Face Tracing fails, pipeline stuck at 35%
|
||||
|
||||
**Needs**:
|
||||
- Check why face.json deleted
|
||||
- Add error handling in Python scripts
|
||||
- Re-run Face Detection if needed
|
||||
|
||||
---
|
||||
|
||||
## Key Insights
|
||||
|
||||
1. **Multiple failure layers**: Architecture → Worker → Python scripts
|
||||
2. **State in memory**: Worker process holds state, DB changes don't help
|
||||
3. **Data integrity critical**: File existence ≠ data completeness
|
||||
4. **No timeout/retry**: Pipeline waits forever for missing data
|
||||
|
||||
---
|
||||
|
||||
## Recommendations
|
||||
|
||||
### Short-term
|
||||
|
||||
1. Fix Python script error handling
|
||||
2. Add retry limits
|
||||
3. Improve error messages to users
|
||||
|
||||
### Long-term
|
||||
|
||||
1. Unified state management (PostgreSQL only)
|
||||
2. Unified data pipeline
|
||||
3. Timeout + retry mechanisms
|
||||
4. Monitoring and alerting
|
||||
|
||||
---
|
||||
|
||||
## Files Changed
|
||||
|
||||
| File | Changes |
|
||||
|------|---------|
|
||||
| `scripts/asr_processor.py` | Common language polling |
|
||||
| `src/worker/job_worker.rs` | Data integrity checks |
|
||||
| PostgreSQL `videos` | Status reset |
|
||||
| Multiple docs | Analysis reports |
|
||||
|
||||
---
|
||||
|
||||
## Lessons Learned
|
||||
|
||||
1. Kill/restart required for state in memory
|
||||
2. Multi-layer debugging necessary
|
||||
3. File existence ≠ data completeness
|
||||
4. Error handling critical at all layers
|
||||
5. Testing needed for edge cases
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
- `2026-09-27_pipeline_architecture_flaws.md`
|
||||
- `2026-09-27_worker_data_integrity_fix.md`
|
||||
- `2026-09-27_020mp4_worker_repair_complete.md`
|
||||
- `2026-09-27_asr_common_language_polling.md`
|
||||
Reference in New Issue
Block a user