Skip to content

Fix TaskThread crash on missing task record#12262

Merged
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
ianu82:codex/fix-task-thread-missing-record-guard
Mar 30, 2026
Merged

Fix TaskThread crash on missing task record#12262
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
ianu82:codex/fix-task-thread-missing-record-guard

Conversation

@ianu82

@ianu82 ianu82 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a null-check in TaskThread.run() for missing task records
  • log the missing record and return early instead of dereferencing None
  • add a unit test for the early-return path

Why

If a task is deleted or not found when a thread starts, task_record is None and the previous code raises an AttributeError while setting context fields.

Validation

  • python3 -m py_compile mindsdb/interfaces/tasks/task_thread.py tests/unit/interfaces/tasks/test_task_thread.py
  • pytest -q tests/unit/interfaces/tasks/test_task_thread.py (fails in this environment due to missing optional dependency mind_castle)

@github-actions

github-actions Bot commented Feb 27, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ianu82

ianu82 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@StpMax StpMax changed the base branch from main to releases/26.1.0 March 30, 2026 13:39
@StpMax StpMax merged commit 6dca0b8 into mindsdb:releases/26.1.0 Mar 30, 2026
13 of 18 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants