Flaky diff behavior #1083
Description
diffmatchpatch.DiffMatchPatch
has a member named DiffTimeout
, which is time.Second
by default. If the diff calculation takes more than that limit, it is aborted and the current, half-baked results are returned immediately. This is really, really evil for all the users. Imagine that you are running some actions which involve go-git diffs under heavy load, e.g. in gitbase, or you run them on a retarded machine, such as TravisCI. You are going to have flaky behavior, which is extremely hard to debug.
I have recently hit this problem in Hercules actually (src-d/hercules#234 (comment)), and it was quite painful.
I suggest to at least make the timeout limit configurable and documented in diff.go
, at maximum set it to a safely big value, like one hour.
cc @ajnavarro