Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Flaky diff behavior #1083

Closed
vmarkovtsev opened this issue Mar 9, 2019 · 0 comments
Closed

Flaky diff behavior #1083

vmarkovtsev opened this issue Mar 9, 2019 · 0 comments

Comments

@vmarkovtsev
Copy link
Contributor

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

vmarkovtsev added a commit to vmarkovtsev/go-git that referenced this issue Mar 10, 2019
Fixes src-d#1083

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
traidare pushed a commit to traidare/go-git that referenced this issue Oct 26, 2024
Fixes src-d/go-git#1083

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant