Skip to content

fix: call _mark_completed on successful task execution - #2614

Closed
handnewb wants to merge 1 commit into
vectorize-io:mainfrom
handnewb:fix/mark-completed-never-called
Closed

fix: call _mark_completed on successful task execution#2614
handnewb wants to merge 1 commit into
vectorize-io:mainfrom
handnewb:fix/mark-completed-never-called

Conversation

@handnewb

@handnewb handnewb commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

In _execute_task_inner(), the _mark_completed() method (line 506 of worker/poller.py) is defined but never called in the success path. Only _mark_failed() is called (in the except Exception block). This causes ALL consolidation tasks to remain stuck in processing state forever with completed_at=NULL, despite the worker logging CONSOLIDATION COMPLETE.

The Fix

One line added after terminal_success = True:

await self._mark_completed(task.operation_id, task.schema)

Impact

  • Every consolidation task that completes successfully stays processing forever
  • Last successful completed_at was weeks/months ago despite consolidation running
  • Worker enters zombie state: my_active: none + claimable=1 but refuses to claim
  • Thousands of memories unconsolidated due to stall loop

Verification

Applied to production instance running v0.8.4:

Metric Before After
pending_consolidation 3,368 0
Task flow stuck processing forever pending → processing → completed
Worker stalls every cycle zero

Related

Closes #2601

Checklist

  • Fix is 1 line, minimal surface area
  • Verified in production for 24h+ with zero regressions
  • No new dependencies or config changes

In _execute_task_inner(), the _mark_completed() method (line 506) is defined
but never called in the success path. Only _mark_failed() is called (in the
except Exception block). This causes ALL consolidation tasks to remain stuck
in 'processing' state forever with completed_at=NULL, despite the worker
logging CONSOLIDATION COMPLETE.

The fix adds a single line after terminal_success = True to call
_mark_completed(), which updates the async_operations row to status='completed'
with completed_at=NOW().

Verified in production on v0.8.4: tasks now flow pending → processing →
completed automatically. pending_consolidation dropped from 3368 → 0 within
hours of applying this fix. Zero zombie worker stalls since.

Closes vectorize-io#2601
@handnewb

handnewb commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Open Issues Without Fix PRs (21 total)

These are all currently open issues in vectorize-io/hindsight that do not have a linked pull request:

🐛 Bugs

🔧 Consolidation / Data Integrity

🧠 Recall / Retrieval / Graph

✨ Enhancements

🛠 Integration / Platform

🧹 Content Quality / Guarding


Issues already covered by open PRs (excluded above):

@handnewb

handnewb commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

CORRIGIDO: Lista completa de issues sem PR (51 de 62)

🐛 Bugs

🔧 Consolidação / Retain / Dados

🧠 Recall / Retrieval / Graph / Modelos Mentais

✨ Enhancements

🛠 Integração / Platforma

🧹 Qualidade de Conteúdo / Guarding

🔐 Auth / Segurança

📋 Organizacional


Issues já cobertos por PRs (11, excluídos acima):

Issue PR
#2601 #2614 (este) + #2608
#2554 #2619 (reranker_max_candidates 300→50)
#2597 + #2506 #2620 (FK violation observation_history)
#2604 #2616
#2594 #2595
#2572 #2589
#2543 #2556
#2507 #2508
#2505 #2511
#2501 #2516 + #2515
#2500 #2502
#2492 #2493
#2488 #2395
#2431 #2486
#2235 #2262

Total: 62 abertos → 11 com PR → 51 sem fix

@benfrank241

Copy link
Copy Markdown
Member

Superseded by #2608 (merged), which fixes the same missing _mark_completed call plus two related gaps: a status-guard so the poller never overwrites a terminal state the executor already wrote (avoids masking a failure as completed), and parent-operation propagation on completion (parity with _mark_failed), with unit coverage for both. Thanks @handnewb — spot-on bug report and repro, and your one-liner was the right diagnosis; going with the fuller version to cover the edges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__mark_completed() is never called after successful task execution

2 participants