Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes from HtmlDiff in final review #67

Open
kmccurley opened this issue Jul 5, 2024 · 0 comments
Open

Fix crashes from HtmlDiff in final review #67

kmccurley opened this issue Jul 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working Priority

Comments

@kmccurley
Copy link
Member

I found an example where calculating HtmlDiff in admin.py::final_review() went into an infinite loop and eventually caused the apache process to time out. In the case that caused the error, it was trying to compare crypto.bib from cryptobib with another small file of the same name, and it ran out of RAM. There is apparently a known problem in HtmlDiff. The solution is not obvious, but I can think of several approaches:

  1. give up on calculating diffs. This would be unfortunate.
  2. only calculate diffs when the files are both small. This has the unfortunate requirement to stat() every file, but would be safer.
  3. only calculate diffs when the files are "relatively close in size". I'm not sure what that would be.
  4. use a second process to timeout the calculation of HtmlDiff. See https://medium.com/@chaoren/how-to-timeout-in-python-726002bf2291 for a way to do this. This seems clumsy but would probably be safe.
@kmccurley kmccurley self-assigned this Jul 5, 2024
@kmccurley kmccurley added Priority bug Something isn't working labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority
Projects
None yet
Development

No branches or pull requests

1 participant