Body
The backfill_job_runner would benefit a lot from refactoring. The gist of it is an 800 line log method that has deep indentations and internal methods, does not use some of the "modernized" ways of doing things (for example retry_db_transaction decorators).
It should be split into smaller logical steps and better documented what it's doing.
That might also help to investigate and fix some of the deadlock issues it is plagued with that we are currently mostly workarounding rather than preventing.
Ideally this could be done in smaller low-risk steps extracting and documenting code piece-by-piece. Might be also a good exercise for someone to learn how it works and document it for others so that this part is quite a bit less mysterious for current and future generations of committers.
Committer
Body
The backfill_job_runner would benefit a lot from refactoring. The gist of it is an 800 line log method that has deep indentations and internal methods, does not use some of the "modernized" ways of doing things (for example retry_db_transaction decorators).
It should be split into smaller logical steps and better documented what it's doing.
That might also help to investigate and fix some of the deadlock issues it is plagued with that we are currently mostly workarounding rather than preventing.
Ideally this could be done in smaller low-risk steps extracting and documenting code piece-by-piece. Might be also a good exercise for someone to learn how it works and document it for others so that this part is quite a bit less mysterious for current and future generations of committers.
Committer