Closed Bug 1426257 Opened 5 years ago Closed 4 years ago

cleanup ProcessorApp._transform()

Categories

(Socorro :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: willkg)

References

Details

Attachments

(1 file)

ProcessorApp._transform() does a bunch of things: fetches the raw crash and dumps, saves the dumps to disk to use later, fetch an existing processed crash if there is one, process the crash, and then save the raw and processed crashes to all the crash storage systems.

Various points in that have different error handling requirements and resource allocation requirements.

Maybe ._transform() should get broken up into separate methods--one for each proper phase? That might simplify the tests since it'd be easier to test individual phases than the whole thing.

This bug covers refactoring this method so that it's:

1. more unified (we've got a lot of redundant error handling code)
2. handles allocating and unallocating resources more responsibly with fewer edge cases (we're pretty sure we're not cleaning up dumps in all cases)
3. easier to read and reason about
Lonnen is currently working on cleaning up the processor. Before anyone works on this, they should check in with him to make sure work on this doesn't block, interfere with, or duplicate his work.
When working on this, we should also fix this exception clause that doesn't send errors to sentry:

https://github.com/mozilla-services/socorro/blob/fc6841672e8179cd6721a52cdc1a34d233338bf2/socorro/processor/processor_app.py#L103-L113

That will finish up the last bits for bug #1362434.
Assignee: nobody → willkg
Commits pushed to master at https://github.com/mozilla-services/socorro

https://github.com/mozilla-services/socorro/commit/a34511375b7180c43d7ed310ae348fe8d840b28d
fix bug 1426257: clean up _transform

This is mostly cosmetic cleanup. The method was already doing most of
what we need it to do in regards to structure and exception handling.

https://github.com/mozilla-services/socorro/commit/31547158fbdab4be0e9a580887ca6b6dc341acdd
Merge pull request #4739 from willkg/1426257-transform

fix bug 1426257: clean up _transform
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.