Changeset - 07f026cdf7ac
default
0
1
0
vcs: catch MemoryErrors when calling Git diff
Binary diffs can make the diffs VERY big and cause MemoryError exceptions.
Before giving MemoryError, the system might start swapping, any process might
fail when allocating memory, random processes might get killed, and our process
might fail in other places. The proper fix would be to avoid the problem by not
trying to process more data than we can handle - for example by not processing
more than a certain amount of Git output.
Before, memory errors were shown to the user as a 500 Internal Server Error
page.
Now, as long as we have no better/safer way get the diff, catch the MemoryError
and show the page with a flash error message and no diff.
The error handling is placed in the diffs module to avoid leaking flash
messages into the vcs lib.
Binary diffs can make the diffs VERY big and cause MemoryError exceptions.
Before giving MemoryError, the system might start swapping, any process might
fail when allocating memory, random processes might get killed, and our process
might fail in other places. The proper fix would be to avoid the problem by not
trying to process more data than we can handle - for example by not processing
more than a certain amount of Git output.
Before, memory errors were shown to the user as a 500 Internal Server Error
page.
Now, as long as we have no better/safer way get the diff, catch the MemoryError
and show the page with a flash error message and no diff.
The error handling is placed in the diffs module to avoid leaking flash
messages into the vcs lib.
1 file changed with 8 insertions and 4 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)