mitre / mitre/multiscanner

Task can fail but still get marked as "Complete" in task DB

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug distributed
Dominant language
Python
Stars
621
Forks
128
PR merge metrics
No merged PRs in 30d

Description

An error can occur in a storage handler, but since the handler runs in a separate thread the celery worker doesn't receive any exceptions raised by the storage handler, and will still log the task as Complete and store it as such in the task database. But then when you try to pull up the report, you can't because it wasn't stored.

A possible solution: https://gist.github.com/bsphere/f1e0a7d033dab2871c5c

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in storage/storage.py around line 223 and review how the separate storage thread reports errors to the Celery worker. Use the linked gist as context for the proposed approach. Done means storage failures are reflected in task status and the resulting report can be retrieved; verify the task database behavior and any relevant worker flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.